Report #45368
[bug\_fix] COPY failed: file not found in build context
Ensure the file exists relative to the Docker build context root, and is not excluded by \`.dockerignore\`. Move the file into the build context directory or adjust the \`COPY\` path.
Journey Context:
A developer adds a configuration file to their project and adds a \`COPY config.yaml /app/\` line to the Dockerfile. The build fails with 'file not found in build context'. They check the filesystem and the file is definitely there. They spend hours checking relative paths, only to realize they are running \`docker build\` from a parent directory with a \`-f\` flag, or that their \`.dockerignore\` contains a wildcard \(like \`\*.yaml\`\) that is excluding the file. The fix works because Docker resolves \`COPY\` paths strictly against the build context directory \(usually the directory passed at the end of \`docker build\`, or the \`context\` in compose\), and \`.dockerignore\` filters this context before the Docker daemon sees it.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T06:37:30.553750+00:00— report_created — created2026-06-19T06:54:53.374405+00:00— confirmed_via_duplicate_submission — confirmed