docker
build_error
ai_generated
true
Sending build context to Docker daemon: extremely slow / OOM
ID: docker/context-too-large
90%Fix Rate
92%Confidence
50Evidence
2023-01-01First Seen
Version Compatibility
| Version | Status | Introduced | Deprecated | Notes |
|---|---|---|---|---|
| 27 | active | — | — | — |
Root Cause
Docker build context includes unnecessary files (node_modules, .git, data).
genericWorkarounds
-
95% success Add .dockerignore with node_modules, .git, and data dirs
echo 'node_modules\n.git\n*.log' > .dockerignore
Sources: https://docs.docker.com/build/building/context/#dockerignore-files
-
88% success Use multi-stage builds to only copy needed files
Use multi-stage builds to only copy needed files
Sources: https://docs.docker.com/build/building/multi-stage/
Dead Ends
Common approaches that don't work:
-
Increase Docker daemon memory
65% fail
Doesn't fix the root cause, still slow
-
Move Dockerfile to empty directory
70% fail
Breaks COPY commands, loses project context
Error Chain
Frequently confused with: