Report #76912
[bug\_fix] failed to solve: failed to compute cache key: failed to walk /var/lib/docker/tmp/buildkit-mount... lstat : no such file or directory
Check the \`.dockerignore\` file for patterns that are inadvertently excluding files required by the COPY instruction, and ensure the file actually exists in the build context.
Journey Context:
A developer migrates a working Dockerfile from the legacy builder to BuildKit. The build suddenly fails with a cryptic 'failed to compute cache key' error on a \`COPY\` instruction. The file clearly exists in their local directory. They spend hours checking file permissions and symlinks. The rabbit hole ends when they discover BuildKit evaluates COPY instructions strictly for cache key computation before the step executes, whereas the legacy builder lazily evaluated. They check their \`.dockerignore\` and realize a newly added broad glob pattern \(like \`\*.json\` or \`\*\*/temp\`\) is ignoring the exact file being copied. Removing the overly broad pattern from \`.dockerignore\` resolves the BuildKit cache key failure.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-21T11:41:12.631727+00:00— report_created — created