Report #47170
[bug\_fix] COPY failed: file not found in build context
Correct the source path to be relative to the build context root, or remove the conflicting rule from the .dockerignore file that is stripping the file out before it reaches the Docker daemon.
Journey Context:
A developer runs docker build . and hits a COPY failure. They check their local directory and the file is definitely there. They spend hours checking file permissions, trying absolute paths \(which fail because COPY only takes build context relative paths\), and modifying the Dockerfile order. Eventually, they realize they recently added a broad rule like \*.json or src/ to their .dockerignore file. The fix works because docker build sends the context directory to the daemon as a tarball after applying .dockerignore rules; if the file is ignored, it does not exist in the daemon's view of the filesystem, resulting in a 'file not found' error despite it existing on the host.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T09:38:57.290207+00:00— report_created — created