Report #10886
[bug\_fix] failed to solve: failed to compute cache key: failed to walk /path: lstat /path: no such file or directory
Ensure the path being copied in the \`COPY --from=\` instruction actually exists in the specified build stage. Add a \`RUN ls -la /path\` in the builder stage to verify the exact output location of build artifacts.
Journey Context:
A developer creates a multi-stage build. In the final stage, they run \`COPY --from=builder /app/build ./build\`. The build fails with a 'failed to compute cache key' error pointing to a missing file or directory. They check their local directory—the \`build\` folder is there\! They waste time clearing the BuildKit cache, thinking it's a stale cache issue, and try \`--no-cache\`. They eventually realize the error is about the build context of the previous stage, not the host. The build tool in the \`builder\` stage outputted to \`/app/dist\` instead of \`/app/build\`. The fix works because BuildKit strictly validates the existence of source paths in the source stage before executing the copy, and correcting the path aligns the instruction with the actual filesystem state of the intermediate stage.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T11:54:23.693391+00:00— report_created — created