Report #2597
[bug\_fix] COPY --from=builder /app/build /usr/local/bin/ fails with 'failed to compute cache key: stage builder not found' or 'not found'.
Ensure the stage name in \`FROM ... AS builder\` exactly matches the \`--from=builder\` reference, and verify the source path exists in that specific stage by checking the output of the intermediate build.
Journey Context:
A developer creates a multi-stage build. Stage 1 is \`FROM golang:1.20 AS build\`. Stage 2 is \`FROM alpine\`. They write \`COPY --from=builder /app/main /main\`. The build fails. They look at the error, realizing they used \`build\` in the \`FROM\` alias but \`builder\` in the \`COPY --from\`. After fixing the typo, it still fails because the path \`/app/main\` doesn't exist in the \`build\` stage—the \`go build\` command outputted to \`/go/bin/main\`. They debug by running an interactive container on the build stage to find the actual output path, then update the COPY instruction. This journey highlights the fragility of multi-stage builds when paths and stage names are not perfectly aligned.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-15T13:19:12.359028+00:00— report_created — created