Report #104315
[bug\_fix] COPY --from=stage\_name: no such stage
Ensure the stage name is spelled correctly and defined with \`AS\` in the Dockerfile. Alternatively, use the numeric index of the stage \(0-based\) or the stage's base image name if no AS is used.
Journey Context:
A developer used a multi-stage Dockerfile with \`COPY --from=builder /app /app\` but the stage was named \`build\` \(without \`er\`\). The error 'no such stage' appeared. They searched for syntax errors, but the issue was a simple typo. Another developer encountered this when moving stages between Dockerfiles and forgetting to add the \`AS\` clause. The fix is to verify stage names in both the COPY directive and the FROM line. The root cause is that Docker BuildKit \(and classic\) requires an exact match of the stage name; there is no fuzzy matching.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-08-02T20:02:32.966851+00:00— report_created — created