Report #11077
[bug\_fix] COPY failed: file not found in build context: stat : file does not exist
Move the file into the build context directory, or adjust the Docker build context path \(e.g., change the \`docker build .\` command to run from a parent directory\). You cannot COPY files using relative paths that navigate outside the build context \(like \`../\`\).
Journey Context:
A developer creates a Dockerfile and tries to COPY a configuration file from a sibling directory using a path like \`COPY ../config/app.conf /etc/app/\`. The build immediately fails. They double-check the file path on their host machine and confirm the file exists. They spend time checking file permissions, ownership, and symlinks before realizing Docker strictly isolates the build to the designated context directory. The Docker daemon cannot access files outside this boundary for security and reproducibility reasons. They restructure the project to run \`docker build\` from the repository root, adjusting the Dockerfile path and the COPY paths accordingly, which resolves the context boundary violation.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T12:23:49.715840+00:00— report_created — created