Report #58984
[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
Remove symlinks in the project directory that point outside the Docker build context, copy the actual file into the context, or adjust the build context to encompass the symlinked directory.
Journey Context:
A developer triggers a build and hits a cryptic 'failed to compute cache key' error. The file exists locally, and the Dockerfile path is correct. They go down a rabbit hole of clearing the build cache \(\`docker builder prune\`\), restarting Docker, and checking disk space. The breakthrough comes when they realize they have a symlink in their project directory that points to a file outside the Docker build context \(e.g., a shared config file in \`../../shared\_config\`\). Docker BuildKit strictly resolves paths and symlinks within the context boundary. When it tries to compute the checksum for the context tarball or the COPY instruction, it follows the symlink, hits a file outside the allowed boundary, and throws a cache key error. The fix works because BuildKit enforces strict security and determinism by forbidding access to files outside the initial context tarball.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-20T05:29:29.890470+00:00— report_created — created