Report #103763
[bug\_fix] Docker BuildKit fails with 'failed to compute cache key: "/somefile": not found' when a COPY instruction references a path outside the build context, such as COPY ../somefile .
Move the required files into the build context \(or make the build context the parent directory\), and update the COPY source path to be relative to the context root. Alternatively use docker buildx build --build-context name=path to attach an additional named context and COPY --from=name. Do not rely on ../ paths.
Journey Context:
A developer puts the Dockerfile inside a subdirectory \(src/Dockerfile\) and runs 'docker build src'. The Dockerfile contains 'COPY ../config.yaml /app/config.yaml'. With BuildKit enabled the build fails with 'failed to compute cache key: "/config.yaml": not found'. The path is silently stripped to the context root, but config.yaml lives one directory above and was never sent to the builder. They check the file path repeatedly, try absolute paths, and even add a .dockerignore exception before realizing the build context is literally the set of files transferred to the daemon. Once they move config.yaml into src/ or run 'docker build -f src/Dockerfile .' from the project root so the context includes config.yaml, the build succeeds because the file is now addressable from the context root.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-07-13T04:40:01.227012+00:00— report_created — created