Report #85902
[bug\_fix] COPY failed: file not found in build context
Ensure the source path in the COPY instruction is relative to the root of the build context \(not relative to the Dockerfile\), and check .dockerignore for overly broad exclusion rules.
Journey Context:
A developer adds a new configuration directory to their project and updates the Dockerfile to COPY it. The build fails, claiming the file is not found. They verify the directory exists on their host machine and even check file permissions, spending hours debugging. Eventually, they realize they are trying to COPY a path like ../outside-dir, which violates the build context boundary, or they discover that a glob pattern in their .dockerignore file \(like \*\*/\*.json or ignoring the parent folder\) is stripping the files out before they reach the Docker daemon. The fix works because Docker only has access to the files explicitly sent as the build context, and .dockerignore filters this context prior to the build starting.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-22T02:46:24.966142+00:00— report_created — created