Report #41062
[bug\_fix] COPY failed: file not found in build context
Review and update the \`.dockerignore\` file to ensure the required files or directories are not being excluded from the build context.
Journey Context:
A developer adds a new configuration file to their repo and updates the Dockerfile to \`COPY config.json /app/\`. The build fails, claiming the file is not found. They verify the path multiple times, even using absolute paths, but it fails. The hidden culprit is the \`.dockerignore\` file, which contains a wildcard like \`\*.json\` or \`config/\` that excludes the file. The Docker client uses \`.dockerignore\` to filter the context tarball before sending it to the daemon. The fix works because removing the exclusion pattern ensures the file is included in the context tarball, making it available to the \`COPY\` instruction.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-18T23:23:36.225602+00:00— report_created — created