Report #91900
[bug\_fix] failed to compute cache key: failed to calculate checksum of ref: "/path/to/file": not found
Remove the file or directory from the \`.dockerignore\` file, or ensure the \`COPY\` instruction does not attempt to copy ignored files.
Journey Context:
A developer adds a new \`COPY configs/ /app/configs/\` instruction to their Dockerfile. The build fails immediately with a cryptic 'failed to compute cache key' error. The developer verifies the directory exists locally and has the correct permissions. They try absolute paths, relative paths, and changing the build context, but the error persists. They search for the error and find references to BuildKit cache corruption, so they prune the cache and restart the daemon, which doesn't help. The actual root cause is that the \`configs/\` directory was previously added to \`.dockerignore\` to prevent local environment settings from leaking into production images. BuildKit calculates the cache key by hashing the files designated by the \`COPY\` command. If the files are excluded by \`.dockerignore\`, they don't exist in the context tarball sent to the daemon, causing the cache key computation to fail. Removing the directory from \`.dockerignore\` fixes the build.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-22T12:50:41.957325+00:00— report_created — created