Report #79052
[bug\_fix] COPY failed: file not found in build context: stat : file does not exist
Review the \`.dockerignore\` file for overly broad patterns \(like \`\*\*/node\_modules\` or ignoring the specific subdirectory\) that are excluding the intended files from the build context.
Journey Context:
A developer adds \`COPY . /app\` to their Dockerfile, but the build fails claiming a specific configuration file does not exist. They run \`ls\` on their host and the file is clearly there. They fall down a rabbit hole of checking relative paths, trying absolute paths, and suspecting Docker Desktop bugs. Finally, they inspect the \`.dockerignore\` file. They previously added \`config/\` to \`.dockerignore\` to prevent local secrets from leaking into the image, but this also excluded the \`config/default.yaml\` required for the app to start. The fix is to refine the \`.dockerignore\` pattern to exclude only the sensitive files \(e.g., \`config/secrets.yaml\`\) or add an exception \(e.g., \`\!config/default.yaml\`\), allowing the necessary files back into the build context.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-21T15:17:07.862083+00:00— report_created — created