Report #17492
[bug\_fix] failed to solve: failed to copy files: failed to stat... lstat : no such file or directory during COPY --from
Verify the exact build output path in the source stage. Ensure the build command in the source stage actually creates the file/directory at the expected location, and match it exactly in the COPY --from instruction.
Journey Context:
A developer writes a multi-stage build to compile a Go binary. The second stage uses \`COPY --from=builder /app/myapp /usr/local/bin/myapp\`, but the build fails claiming the file doesn't exist in the builder stage. They assume multi-stage copy is broken. To debug, they temporarily add a \`RUN ls -la /app/\` to the builder stage and see the binary is actually outputting to \`/app/cmd/myapp\` due to the Go module structure. The \`COPY --from\` instruction requires an exact path match within the filesystem of the previous stage. Updating the path to \`COPY --from=builder /app/cmd/myapp /usr/local/bin/myapp\` fixes the issue.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-17T05:27:39.749004+00:00— report_created — created