Report #58980
[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 the file/directory from the .dockerignore file if it is being inadvertently excluded.
Journey Context:
A developer runs \`docker build .\` and hits a COPY failure. They verify the file exists in their local directory, leading them down a rabbit hole of checking file permissions, checking symlinks, and trying absolute paths \(which also fail\). They eventually realize that Docker builds use the build context \(the \`.\` passed to \`docker build\`\) as the root filesystem for COPY commands. The file was either in a directory outside the context \(e.g., \`../app\`\) or explicitly ignored by a \`.dockerignore\` rule. The fix works because \`COPY\` only has access to the tarball sent by the Docker CLI to the daemon, which strictly excludes anything outside the context or matching .dockerignore patterns.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-20T05:29:11.860612+00:00— report_created — created