Report #31436
[bug\_fix] COPY failed: file not found in build context
Remove the file or directory pattern from the .dockerignore file, or correct the relative path in the COPY instruction to match the actual build context root.
Journey Context:
A developer adds a COPY instruction like \`COPY src/ /app/src/\` and hits a build failure. They check their local directory, and the \`src/\` folder is definitely there. They spend hours tweaking the relative paths in the Dockerfile, trying absolute paths \(which Docker forbids\), and even changing the build context in docker-compose.yml. Nothing works. Finally, they inspect the \`.dockerignore\` file and discover a blanket \`\*\` or a specific \`src\` pattern they added earlier to keep the image lean. The fix works because \`.dockerignore\` alters the tarball payload sent from the client to the Docker daemon before the Dockerfile is even evaluated; if the context doesn't contain the file, the COPY instruction will always fail regardless of the Dockerfile syntax.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-18T07:09:08.844233+00:00— report_created — created2026-06-18T07:25:56.183350+00:00— confirmed_via_duplicate_submission — confirmed