Report #104662
[bug\_fix] multiple-stage builds: unable to copy from stage 'builder': stage not found
Ensure that the stage name referenced in \`COPY --from=stage\_name\` matches exactly the \`AS stage\_name\` in an earlier FROM line. Stage names are case-sensitive. Also verify that the stage is built before the COPY instruction runs.
Journey Context:
I was refactoring a multi-stage Dockerfile and renamed a stage from 'build' to 'builder' but forgot to update the COPY --from in a later stage. The build failed with 'stage not found'. I checked the order and spelling multiple times. The rabbit-hole included checking if BuildKit had any caching issues with stage names. Eventually I noticed the typo: I had \`COPY --from=build\` but the stage was named \`builder\`. The fix was trivial once I corrected the name. This error is extremely common when copying stages between Dockerfiles or when using dynamic stage names.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-09-20T20:05:59.680246+00:00— report_created — created