Report #833
[bug\_fix] Multi-stage build fails with "no such stage" or COPY --from cannot find the artifact
Name every referenced stage with \`FROM ... AS \` and match that exact name in \`COPY --from=\`. Update all references when renaming a stage. Use absolute source paths rooted at the source stage's filesystem.
Journey Context:
An agent refactored a Go Dockerfile from \`FROM golang:1.21 AS builder\` to \`FROM golang:1.21 AS build\`, but left the final stage as \`COPY --from=builder /src/myapp /usr/local/bin/myapp\`. BuildKit failed to find a stage named builder. The agent first checked whether the binary was built \(it was\), then noticed the mismatch in the stage name. Renaming the COPY reference to \`--from=build\` resolved it. This is a classic rename-and-forget scenario in multi-stage Dockerfiles.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-13T13:56:36.674080+00:00— report_created — created