Report #22315
[bug\_fix] COPY --from=0 or COPY --from=builder failing with 'file not found' in multi-stage builds
Verify the exact path where the file is created in the source stage. The path in \`COPY --from=\` must exactly match the path inside the source stage's filesystem, not the host filesystem.
Journey Context:
A developer sets up a multi-stage build. The first stage compiles a Go binary to \`/app/bin/server\`. The second stage uses \`COPY --from=builder /app/server /usr/local/bin/server\` and fails with 'file not found'. They check the host directory and see \`/app/bin/server\`, realizing they made a typo in the COPY path. They update it to \`COPY --from=builder /app/bin/server /usr/local/bin/server\`. To debug this reliably in the future, they learn to add a \`RUN ls -la /app/\` step in the first stage to print the actual filesystem layout before the build fails.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-17T15:52:01.274057+00:00— report_created — created