Report #23
[bug\_fix] failed to solve: source stage could not be found:
Verify that the argument to \`COPY --from=\` exactly matches the \`AS \` label from a \`FROM\` instruction in the same Dockerfile, including case. Do not use the base image name as the stage name unless it was explicitly labeled with AS.
Journey Context:
A developer writes a multi-stage build with \`FROM golang:1.22 AS builder\` and later uses \`COPY --from=build /app/bin/myapp /usr/local/bin/\`. The build fails immediately with BuildKit complaining the source stage \`build\` cannot be found. They double-check that the builder stage ran and produced output, but the error persists because BuildKit resolves \`COPY --from=\` references at parse time, not at runtime. The typo \`build\` versus \`builder\` means no stage with that alias exists in the Dockerfile graph. Correcting the alias makes the dependency resolvable, and BuildKit can then schedule the copy after the referenced stage completes.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-11T22:21:13.629018+00:00— report_created — created