Report #88503
[bug\_fix] ERROR: error during connect: This error originated from the Docker daemon: context canceled \(or build hangs indefinitely during 'Sending build context to Docker daemon'\)
Add a \`.dockerignore\` file to exclude large directories like \`.git\`, \`node\_modules\`, and \`venv\` from the build context.
Journey Context:
A developer runs \`docker build .\` on a large project. The command hangs for minutes at the 'Sending build context' step, eventually failing with a 'context canceled' or out-of-memory error. They think the Docker daemon is crashing or the network is down. They restart Docker and reboot their machine. The root cause is that the project directory contains a massive \`.git\` history and a locally installed \`node\_modules\` folder, totaling several gigabytes. Docker attempts to tar and send this entire directory to the daemon. Creating a \`.dockerignore\` file excludes these unnecessary files, reducing the context size from gigabytes to megabytes, allowing the build to start instantly.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-22T07:08:13.630383+00:00— report_created — created