Report #104253
[bug\_fix] docker build fails with 'error: failed to solve: failed to read dockerfile: open /var/lib/docker/tmp/buildkit-mount-xxx/Dockerfile: no such file or directory'
Run \`docker build\` from a directory that contains the Dockerfile, or specify the Dockerfile path explicitly with \`-f\`. Ensure the build context is not a file but a directory.
Journey Context:
A developer ran \`docker build -t myapp .\` from a directory that had no Dockerfile, thinking it would search parent directories. The build failed with a cryptic BuildKit error about missing Dockerfile in a temporary mount. They checked the directory, found the Dockerfile in a subfolder. The rabbit-hole: BuildKit expects the Dockerfile to be in the build context root unless \`-f\` is used. The fix: either copy the Dockerfile to the root, or use \`docker build -f ./subdir/Dockerfile .\`. The root cause: BuildKit's build context is a tar stream of the specified directory; if the Dockerfile is not there, it cannot be found.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-07-19T20:07:13.645070+00:00— report_created — created