docker
build_error
ai_generated
true
求解失败:前端 dockerfile.v0:无法解析 dockerfile 前端镜像:docker/dockerfile:1:未找到
failed to solve: frontend dockerfile.v0: failed to resolve dockerfile frontend image: docker/dockerfile:1: not found
ID: docker/buildkit-frontend-image-not-found
80%修复率
84%置信度
1证据数
2023-11-05首次发现
版本兼容性
| 版本 | 状态 | 引入 | 弃用 | 备注 |
|---|---|---|---|---|
| Docker 23.0.5 | active | — | — | — |
| BuildKit 0.11.6 | active | — | — | — |
| Dockerfile 1.5.0 | active | — | — | — |
根因分析
Dockerfile 语法指令中指定的 BuildKit 前端镜像不可用或无法访问注册表。
English
The BuildKit frontend image specified in the Dockerfile's syntax directive is not available or the registry is unreachable.
官方文档
https://docs.docker.com/build/buildkit/#getting-started解决方案
-
Explicitly set the syntax directive at the top of the Dockerfile: `# syntax=docker/dockerfile:1.5.0` and ensure the BuildKit version supports it. Then build with `DOCKER_BUILDKIT=1 docker build .`
-
If behind a proxy, configure Docker daemon proxy settings in `/etc/systemd/system/docker.service.d/http-proxy.conf` to allow BuildKit to reach the registry.
无效尝试
常见但无效的做法:
-
60% 失败
Disabling BuildKit may work but loses build optimizations and can cause other errors if the Dockerfile uses syntax features only supported by BuildKit.
-
70% 失败
The error is not about a missing local image; BuildKit tries to fetch the image from the registry during build, and pulling it manually may not resolve the issue if the registry is blocked.