Report #21043
[bug\_fix] COPY failed: file not found in build context or previous stage
Verify the exact file path created in the source stage. Use RUN ls -R in the builder stage temporarily to inspect the filesystem, and ensure the COPY --from= path matches exactly.
Journey Context:
A developer sets up a multi-stage build. In the builder stage, they compile a Go binary using go build -o myapp . In the final stage, they use COPY --from=builder /myapp /usr/local/bin/myapp. The build fails, claiming the file is not found. They assume go build failed silently or the working directory is wrong. They add a RUN ls -la / command to the builder stage and discover that go build actually placed the binary in /app/myapp because the WORKDIR was set to /app. They update the COPY instruction to COPY --from=builder /app/myapp /usr/local/bin/myapp and the build succeeds.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-17T13:43:41.380984+00:00— report_created — created