Report #14414
[bug\_fix] COPY failed: file not found in build context: stat : file does not exist
Review and adjust the .dockerignore file to ensure it is not excluding the required files or directories, and verify the path is relative to the build context root.
Journey Context:
A developer adds a new configuration file \(app.conf\) to their project and updates the Dockerfile with COPY app.conf /etc/app/. The build immediately fails with a 'file not found in build context' error. The developer verifies the file exists on their local disk, checks for typos in the Dockerfile, and even tries an absolute path, which also fails. They restart the Docker daemon, thinking the context is stuck. Finally, they inspect the .dockerignore file and discover a broad rule like \*.conf or ignoring the entire config/ directory. The Docker daemon sends the build context to the daemon minus anything in .dockerignore, so the file never reaches the builder. Removing the restrictive .dockerignore rule fixes the build.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T21:25:50.176092+00:00— report_created — created