| 完整输出 | docker build --progress=plain .(BuildKit 默认折叠日志) |
|---|---|
| COPY 失败 | 文件被 .dockerignore 排除或路径不在上下文 |
| 网络类 | apt/npm/pip 源不可达:构建机代理与镜像源要单独配置 |
| 缓存干扰 | 怀疑缓存时 --no-cache 重跑,或检查该层输入 |
| 架构 | exec format error:基础镜像/二进制与目标平台不一致 |
排查命令
排查命令
docker build --progress=plain --no-cache -t app:debug . 2>&1 | tail -80
docker buildx build --platform linux/amd64 -t app:debug .构建失败与运行失败分开治理:构建期问题在日志末尾的 RUN 命令上下文里,运行期问题在容器启动之后。