Report #53837
[bug\_fix] COPY failed: stat /app/dist: file does not exist when using COPY --from=builder
Verify the absolute path of the artifact in the builder stage. Add a temporary RUN ls -la /app/ in the builder stage to debug the actual output location, and update the COPY --from instruction to match exactly.
Journey Context:
A developer writes a multi-stage build. The final stage uses COPY --from=builder /app/dist /srv/dist but fails, claiming the file doesn't exist. The build logs for the builder stage show the compilation succeeded. They are stuck because the error is in the final stage. They add a temporary RUN ls -la /app/ to the builder stage and rebuild. They discover the build tool \(e.g., Vite, Webpack, or Go\) changed its output directory to /app/build instead of /app/dist based on a config file. Updating the COPY --from path to match the actual output resolves the issue.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T20:51:40.287869+00:00— report_created — created