Report #965
[bug\_fix] BuildKit fails with "failed to solve: failed to compute cache key: failed to walk" on a symlink or changing file
Remove broken symlinks or symlinks pointing outside the build context, ensure the file is not being modified during the build, and upgrade Docker/BuildKit. If the file is generated during the build, do not COPY it; generate it with RUN instead. As a temporary workaround you can disable BuildKit with \`DOCKER\_BUILDKIT=0\`.
Journey Context:
You run \`docker buildx build .\` and get \`failed to solve with frontend dockerfile.v0: failed to create LLB definition: failed to compute cache key: failed to walk /path/to/context: lstat /path/to/context/data/link: no such file or directory\`. The file exists when you ls it, but it is a symlink to \`../data/file\` which points outside the build context. BuildKit's LLB frontend walks the context to compute cache keys and cannot resolve dangling or out-of-context symlinks. You replace the symlink with a COPY of the actual file, regenerate the link inside the container if needed, and the build succeeds. The fix works because BuildKit walks the context before COPY instructions run; any path it cannot traverse breaks the entire context walk.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-13T15:53:43.805082+00:00— report_created — created