Report #93332
[bug\_fix] .dockerignore patterns failing to exclude hidden files like .env or subdirectory node\_modules
Use explicit patterns for hidden files \(e.g., \*\*/.env\) and ensure .dockerignore is placed at the root of the build context, as it uses Go filepath.Match rules, not standard bash globbing.
Journey Context:
A developer adds .env to .dockerignore but secrets still end up in the built image. They try \*.env, but files in subdirectories are still included. They realize .dockerignore pattern matching for files in subdirectories requires the \*\* wildcard, and hidden files must be explicitly matched with the leading dot. Furthermore, they had placed the .dockerignore file in a subdirectory instead of the build context root. They update the pattern to \*\*/.env and move .dockerignore to the root, successfully excluding the secrets and reducing the build context size.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-22T15:14:39.447941+00:00— report_created — created