Docker "failed to solve: dockerfile.v0: not found" in CI
The BuildKit dockerfile frontend could not read the Dockerfile it was told to use. The file is missing, named differently, or the -f path does not resolve against the build context.
What this error means
A build fails immediately with failed to solve with frontend dockerfile.v0: failed to read dockerfile: open /.../Dockerfile: no such file or directory. No build steps run.
ERROR: failed to solve: failed to read dockerfile: open /var/lib/docker/tmp/buildkit-mount123/Dockerfile: no such file or directoryCommon causes
No Dockerfile in the build context
The default Dockerfile is not at the context root, and no -f was given.
Wrong -f path
The -f / --file path points somewhere the file is not, or is relative to the wrong directory.
Non-standard filename not specified
A Dockerfile.prod or similar exists but the build did not pass -f to select it.
How to fix it
Point at the right Dockerfile and context
- Pass -f with the exact Dockerfile path and the context directory.
- Confirm the file exists at that path in CI.
docker build -f docker/Dockerfile.prod -t app .Set file and context in the build action
- On docker/build-push-action, set file and context explicitly.
- uses: docker/build-push-action@v6
with:
context: .
file: docker/Dockerfile.prodHow to prevent it
- Always set context and file explicitly in CI builds, and keep the Dockerfile path stable so a moved file does not silently break the build.