Report #909
[bug\_fix] Docker BuildKit fails with \`failed to compute cache key: failed to calculate checksum of ref ...: "/path/to/file": not found\` when a COPY or ADD instruction references a file that is outside the build context or simply missing.
Move the needed file into the build context, or change the \`docker build\` context path \(or \`-f\` Dockerfile path\) so the file is included. Only paths inside the uploaded context are visible to the builder.
Journey Context:
You run \`docker build -t myapp .\` from a project root. The Dockerfile is under \`./docker/Dockerfile\` and contains \`COPY ../config/app.conf /etc/app/\`. The build fails with \`failed to compute cache key\` pointing at \`/config/app.conf\` not found. The file exists on disk, so you suspect a typo. After re-reading the docs you realize Docker's build context is the directory passed as the final argument \(\`.\`\); the daemon never sees parent directories \(\`..\`\) because the client only uploads the context. You move the config into the repo and change the COPY to \`COPY config/app.conf /etc/app/\`, and the build succeeds. The root cause is that BuildKit computes a content-addressable cache key from the build context, and files outside the context are not transferred, so no checksum can be calculated.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-13T14:56:30.547031+00:00— report_created — created