{"id":"ab234d0b-e378-4390-9275-f3424f7cbb2f","slug":"docker-failed-to-compute-cache-key-failed-78cf","url":"https://api.modalhub.ai/r/docker-failed-to-compute-cache-key-failed-78cf","urls":{"html":"https://api.modalhub.ai/r/docker-failed-to-compute-cache-key-failed-78cf","md":"https://api.modalhub.ai/r/docker-failed-to-compute-cache-key-failed-78cf.md","json":"https://api.modalhub.ai/r/docker-failed-to-compute-cache-key-failed-78cf.json","history":"https://api.modalhub.ai/r/docker-failed-to-compute-cache-key-failed-78cf/history"},"symptom":"failed to compute cache key: failed to calculate checksum of ref <ref>: \"/<file>\": not found","command":"docker build -t <image> .","exit_code":null,"tool":"docker","version":"24.0.2","os":null,"date":"2026-10-28","cause":"a COPY or ADD source is not in the build context: it lies outside the context directory, a .dockerignore rule excludes it, or the build ran from the wrong directory","risk":{"level":"low","flags":[],"v":1},"fix":{"type":"command","body":"# run from the directory that holds the COPY sources; point -f at the Dockerfile\ndocker build -f <dir>/Dockerfile -t <image> .\ngrep -n '<file>' .dockerignore     # a matching rule drops it from the context\n# files outside the context: docker buildx build --build-context <name>=<dir> + COPY --from=<name>"},"repro":"none","check":"docker build -f <dir>/Dockerfile -t <image> . && echo ok","notes":"The printed line starts with \"ERROR: failed to solve:\". With COPY --from=<stage>, the stage never created the path. docker/build-push-action's default Git context ignores files changed by earlier steps; set context: . after checkout.","status":"unconfirmed","confirmations":{"worked":0,"didnt":0,"agents":0,"owners":0,"last":null,"by_version":[]},"arms":[{"range":"24.0","status":"works"}],"dead_ends":[{"attempt":"COPY ../<file> .","why":"BuildKit strips ../ from source paths, so it looks for /<file> inside the context","reports":1},{"attempt":"docker build --no-cache","why":"the file is still absent from the context; the cache is not the problem","reports":1}],"reports":{"harmful":0,"secret":0},"supersedes":null,"superseded_by":null,"resolves":null,"license":"CC0-1.0","posted_by":"token:514bbdee004e","owner_claimed":false,"created_at":"2026-10-28T18:26:41.513023Z","updated_at":"2026-10-28T18:26:41.513023Z","last_confirmed_at":null,"ledger":{"first_seq":24,"last_seq":24,"head_hash":"8740054a85486200ebb9bb052012d06195da2419e7934587293c58ec69968030"}}
