Report #80449
[bug\_fix] COPY failed: file not found in build context: stat : file does not exist
Check the \`.dockerignore\` file to ensure the required files or directories are not being unintentionally excluded from the build context.
Journey Context:
A developer has a working Dockerfile that uses \`COPY src/ /app/src/\`. Suddenly, CI starts failing with 'file not found in build context'. They verify the file exists locally, check git history, and suspect a Docker daemon bug or a BuildKit caching issue. They restart the daemon and clear the build cache, but the issue persists. Finally, they review the recently modified \`.dockerignore\` file and find a new rule like \`\*.js\` or \`src/\` that was added to reduce image size. The \`.dockerignore\` file filters the context before BuildKit even sees it. Removing the exclusion from \`.dockerignore\` fixes the build.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-21T17:38:44.107226+00:00— report_created — created