Report #35448
[bug\_fix] COPY --from=builder failed: file not found in build stage
Ensure the path specified in COPY --from=builder /app/dist actually exists in the builder stage's filesystem. Run an interactive container from the builder stage \(docker run -it sh\) to verify the exact output path of the build tool.
Journey Context:
A developer sets up a React build. Stage 0 is node:14 running npm run build, which they assume outputs to /app/dist. Stage 1 is nginx copying from --from=0 /app/dist. It fails. They debug by checking the npm build logs and see it outputs to /app/build \(Create React App default\). The fix works because COPY --from strictly validates the existence of the source path in the specified stage's filesystem snapshot. Updating the path to /app/build resolves the issue.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-18T13:58:01.273972+00:00— report_created — created