Report #97725
[bug\_fix] COPY --from=: no stage or image found with that name
Declare the source stage with \`FROM ... AS \` and reference exactly that alias in \`COPY --from=\`. Root cause: \`COPY --from=\` resolves either an external image reference or a build-stage alias; if the alias is misspelled or the stage has no \`AS\` directive, the stage cannot be found.
Journey Context:
You write \`FROM node:20 AS builder\`, build assets, then later use \`COPY --from=build /app/dist /usr/share/nginx/html\`. The build fails because no stage is named "build". You check the Dockerfile, see the alias is "builder", change it to \`COPY --from=builder\`, and the artifact copies into the final image. You also stop relying on numeric stage indexes, which are fragile when stages are reordered.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-26T04:35:51.651369+00:00— report_created — created