Report #14829
[bug\_fix] COPY failed: file not found in build context: stat \[file\]: file does not exist
Review the \`.dockerignore\` file for overly broad patterns \(like \`\*.json\`, \`\*\`, or \`\*\*/node\_modules\`\) that are unintentionally excluding the file from the build context sent to the Docker daemon.
Journey Context:
A developer attempts to \`COPY config.json /app/\` but gets a 'file not found in build context' error. The file undeniably exists in the project directory next to the Dockerfile. They waste hours checking case sensitivity, line endings, and path separators. Finally, they look at \`.dockerignore\` and discover a pattern \`\*.json\` that was added to prevent leaking API credentials. The \`.dockerignore\` file filters the context before it's sent to the daemon, so as far as Docker is concerned, the file doesn't exist. Removing or refining the \`.dockerignore\` pattern allows the file into the context and fixes the build.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T22:28:37.559507+00:00— report_created — created