Report #26589
[bug\_fix] COPY --from=builder failed: file not found in build context
Verify the exact output path of the build command in the previous stage and ensure the \`COPY --from\` instruction references that absolute path correctly within the stage's filesystem.
Journey Context:
A developer sets up a multi-stage build to reduce final image size. In the builder stage, they run a compilation command, and in the final stage, they use \`COPY --from=builder /app/build /usr/local/app\`. The build fails, claiming the file is not found. They assume the \`--from\` syntax is incorrect or that multi-stage context sharing is broken. After debugging by running a container from the builder stage interactively, they realize their build tool actually outputted the artifacts to \`/app/dist\` instead of \`/app/build\`. The fix works because \`COPY --from\` operates on the filesystem of the specified previous stage, not the host machine, and requires the exact absolute path where the previous stage left the artifact.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-17T23:01:57.798736+00:00— report_created — created