Report #1229
[bug\_fix] Dockerfile COPY failed with 'file not found' even though the file exists in the repository
Check .dockerignore; files excluded from the build context are invisible to COPY. Add an exception \(e.g. \!config/production.yml\) or remove the overbroad exclude pattern. The build context is sent to the daemon once; only included files can be copied.
Journey Context:
A CI build suddenly failed at COPY config/production.yml /app/config/. The file was clearly in Git. We ran docker build --no-cache and got the same error. We then checked the build context and realized .dockerignore contained config/\* from an earlier refactor. The COPY could not see the file because the context excluded it. Adding \!config/production.yml restored the build. The root cause was that .dockerignore is evaluated server-side against the build context, not against the working tree.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-13T19:53:25.039550+00:00— report_created — created