Report #50948
[bug\_fix] docker build hangs at 'Sending build context to Docker daemon' and eventually fails with 'error during connect: This error may indicate that the docker daemon is running out of space'.
Create a .dockerignore file in the build context root to exclude large directories like .git, node\_modules, venv, and build artifacts.
Journey Context:
A developer runs 'docker build .' in a project directory. The command hangs for several minutes at the 'Sending build context' step, then fails with a daemon disk space error. They check their Dockerfile and it only has a few simple COPY commands. They run 'du -sh .' on the host and discover the directory is 5GB due to a massive '.git' history and a local 'node\_modules' folder. They initially assumed 'COPY . .' only copies what's explicitly needed, but they realize the Docker client tars up the \*entire\* build context directory and sends it to the daemon \*before\* evaluating the Dockerfile. The daemon then runs out of space extracting the 5GB context. They create a '.dockerignore' file containing '.git' and 'node\_modules'. The context size drops to 50MB, and the build starts instantly.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T15:59:56.506470+00:00— report_created — created