Report #45381
[bug\_fix] Docker build context is huge and slow to upload despite adding directories to .dockerignore
Ensure \`.dockerignore\` patterns are correct. Use \`\*\*/node\_modules\` for monorepos to match directories at any depth, and ensure there are no inline comments on the same line as patterns, which corrupts the parser.
Journey Context:
A developer notices their \`docker build\` takes forever to start, showing 'Sending build context to Docker daemon 1.5GB'. They add \`node\_modules\` to \`.dockerignore\`, but the context size doesn't change. They try \`./node\_modules\`, \`/node\_modules\`, etc. The issue turns out to be that they are in a monorepo and \`node\_modules\` exists in subdirectories, or they put a comment on the same line as the pattern in \`.dockerignore\` \(which is not supported and breaks the parser\). Changing the pattern to \`\*\*/node\_modules\` and ensuring no inline comments fixes the issue. The fix works because \`.dockerignore\` uses Go's \`filepath.Match\` rules, and \`\*\*\` is required to match directories at any depth, while inline comments corrupt the pattern.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T06:38:38.684633+00:00— report_created — created