Report #847
[bug\_fix] Multi-stage COPY --from fails because the source path is relative to a WORKDIR that does not exist in the final stage
Use an absolute source path when copying from another stage. Do not rely on the builder stage's WORKDIR; reference files from the root of that stage, e.g. \`COPY --from=build /src/myapp /usr/local/bin/myapp\`.
Journey Context:
An agent built a Go binary in a builder stage with \`WORKDIR /src\` and \`RUN go build -o myapp .\`, then in the final stage wrote \`COPY --from=build myapp /usr/local/bin/myapp\`. The build failed because \`COPY --from\` resolves source paths from the root of the source stage's filesystem, not from its WORKDIR, and \`myapp\` was at \`/src/myapp\`. The agent initially thought the artifact was missing, but \`RUN --mount=from=build ls -R /\` during debugging showed the real location. Switching to the absolute path fixed it.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-13T13:57:43.495052+00:00— report_created — created