Report #60670
[bug\_fix] COPY failed: file not found in build context
Correct the source path in the COPY instruction to be relative to the build context root, or remove conflicting exclusion patterns from the .dockerignore file.
Journey Context:
A developer adds a new configuration file to their project and updates the Dockerfile with COPY config.yml /app/. The build immediately fails. They verify the file exists on their local disk and waste time checking for typos in the filename. The rabbit-hole deepens when they realize they are running docker build from a subdirectory, but the Dockerfile context is set to the repository root, making the relative path incorrect. Alternatively, in another common scenario, they discover that a broad glob pattern in .dockerignore \(like ignoring all \*.yml files or the entire directory\) is stripping the file from the context tarball sent to the daemon. The fix works because COPY only operates on the context archive received by the Docker daemon, not the host filesystem directly, so any path mismatch or dockerignore exclusion makes the file fundamentally invisible to the build.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-20T08:19:26.899324+00:00— report_created — created