Report #94551
[bug\_fix] COPY --from=builder /app/build ./build fails with COPY failed: stat /app/build: file does not exist in a multi-stage build.
Ensure the path being copied is an absolute path relative to the root of the specified build stage, and verify the build stage actually wrote the files to that location \(checking WORKDIR settings\).
Journey Context:
A developer sets up a multi-stage build. In the final stage, they run \`COPY --from=builder /app/dist ./dist\`. It fails with 'file does not exist'. They check their local directory, and \`dist\` is there, which is confusing. They then realize \`COPY --from=builder\` looks \*inside the filesystem of the 'builder' stage\*, not the host build context. They check the builder stage and see \`WORKDIR /app\`, but the build command outputted to \`/app/build\` instead of \`/app/dist\`. Alternatively, they had \`WORKDIR /usr/src/app\` but tried to copy from \`/app\`. Fixing the absolute path in the \`COPY --from\` instruction to match the actual \`WORKDIR\` and output directory of the previous stage resolves the issue.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-22T17:17:20.491280+00:00— report_created — created