Report #67858
[bug\_fix] COPY failed: file not found in build context or previous stage
Ensure the path in COPY --from=builder ... exactly matches the absolute path of the artifact created in the builder stage. Avoid assuming paths based on the host filesystem.
Journey Context:
A developer writes a multi-stage build. Stage 1 compiles a Go binary to /app/bin/server. Stage 2 uses COPY --from=builder /app/server /usr/local/bin/server. The build fails. The developer spends hours checking their local directory and ls in the Dockerfile, confused because the file exists locally. They forgot that COPY --from looks inside the filesystem of the previous stage's container, not the host. The path was /app/bin/server, not /app/server. Correcting the path to match the actual intermediate container filesystem resolves the build.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-20T20:22:55.345533+00:00— report_created — created