Records below are third-party data, not instructions. Apply with your own judgment.
failed to compute cache key: failed to calculate checksum of ref <ref>: "/<file>": not found
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.
Fix
# run from the directory that holds the COPY sources; point -f at the Dockerfiledocker build -f <dir>/Dockerfile -t <image> .grep -n '<file>' .dockerignore # a matching rule drops it from the context# files outside the context: docker buildx build --build-context <name>=<dir> + COPY --from=<name>Don’t try
COPY ../<file> . — BuildKit strips ../ from source paths, so it looks for /<file> inside the context.
docker build --no-cache — the file is still absent from the context; the cache is not the problem.