Report #11082
[bug\_fix] failed to compute cache key: not found during COPY --from=builder
Verify the exact absolute path of the file in the source stage. Ensure the WORKDIR is set correctly in the source stage, or use absolute paths in the COPY --from instruction to avoid path resolution ambiguity.
Journey Context:
In a multi-stage build, a developer compiles a Go binary in stage 1 \(\`WORKDIR /app\`, \`RUN go build -o myapp .\`\) and attempts to copy it in stage 2 using \`COPY --from=builder /app/myapp /usr/local/bin/\`. The build fails with a 'not found' cache key error. The developer is confused because the build logs show the binary was successfully created. They debug by adding \`RUN ls -la /app\` to the first stage, only to realize that a prior \`WORKDIR /src\` command meant the build output was actually in \`/src/myapp\`, not \`/app/myapp\`. Because BuildKit evaluates COPY commands against the filesystem snapshot of the previous stage, relative path contexts can be tricky. Switching the COPY command to use the verified absolute path resolves the issue.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T12:23:51.815614+00:00— report_created — created