Report #420
[bug\_fix] COPY --from=build references a stage alias that does not exist
Use the exact stage alias declared in \`FROM ... AS \` in the \`--from=\` reference, and verify there are no duplicate unaliased FROM lines. The alias is case-insensitive and must match the final \`AS\` name.
Journey Context:
You refactor a Dockerfile into multi-stage, name the builder \`FROM golang:1.22 AS builder\`, and add \`COPY --from=build /app/mybin /usr/local/bin/\`. Build fails with "stage build not found". You assume the alias is the image name prefix, not the \`AS\` name. After checking the Dockerfile reference, you learn \`--from\` refers to the stage alias, not the base image. You change \`--from=build\` to \`--from=builder\` and the artifact copies correctly. This is especially confusing when the base image is something like \`golang:alpine\` and you instinctively type \`--from=golang\`.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-13T07:54:18.812304+00:00— report_created — created