Report #75965
[bug\_fix] COPY failed: stat /app/dist: file does not exist when using COPY --from=builder ...
Ensure the build tool in the builder stage actually outputted files to the expected absolute path, and that the path in COPY --from matches the WORKDIR or absolute path of the previous stage.
Journey Context:
A developer sets up a multi-stage build. Stage 1 \(builder\) runs npm run build. Stage 2 runs COPY --from=builder /app/dist /usr/share/nginx/html. The build fails with 'file does not exist'. They assume multi-stage syntax is broken or --from is misreferenced. They debug by running the builder stage interactively \(docker run -it sh\) and looking for the files. They discover the build tool outputted to /app/build instead of /app/dist because of a misconfigured vite.config.js. The --from path was just wrong based on the actual artifact location. Updating the Dockerfile path to /app/build fixes it.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-21T10:05:52.363459+00:00— report_created — created