Report #35463
[bug\_fix] Build context is massive \(e.g., 2GB\+\) despite adding directories to .dockerignore
Ensure the .dockerignore file is located at the root of the build context \(the directory passed to docker build\), not in a subdirectory next to the Dockerfile.
Journey Context:
A developer runs docker build -t myapp . and waits 5 minutes for 'Sending build context to Docker daemon'. They add node\_modules to .dockerignore, but it still sends 2GB. The rabbit hole: they put the .dockerignore file inside the frontend/ directory alongside the Dockerfile, but the build context is the repo root \(.\). Docker only looks for .dockerignore at the root of the build context. Moving .dockerignore to the repo root fixes the context size issue. The fix works because Docker strictly defines the build context root as the directory passed to the build command, and only checks for ignore rules there.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-18T13:59:55.586176+00:00— report_created — created