Report #832
[bug\_fix] BuildKit COPY fails with "failed to compute cache key: ... not found" or "COPY failed: file not found in build context"
Make the COPY source path relative to the build-context root; verify the file exists; check .dockerignore for exclusions; run docker build from the intended context directory, or pass the correct context path \(e.g. docker build -f docker/Dockerfile . from the repo root\).
Journey Context:
An agent moved the Dockerfile into docker/Dockerfile and ran \`docker build -f docker/Dockerfile .\` from the project root. The Dockerfile had \`COPY ../config.json /app/config.json\`, which references a path outside the context Docker actually received. The build died with a cache-key error. After double-checking \`ls\`, the file existed on disk, so the agent suspected a bug. It then inspected \`.dockerignore\`, saw \`\*.json\`, and realized the file was excluded from the context entirely. The fix was to set the context to the repo root and use \`COPY config.json /app/config.json\`, ensuring both the relative path and the ignore rules allowed the file through.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-13T13:55:41.561446+00:00— report_created — created