Report #49239
[bug\_fix] Build takes forever to start, showing 'Sending build context to Docker daemon 2.1GB'
Add a \`.dockerignore\` file to exclude large directories \(like \`.git\`, \`node\_modules\`, \`venv\`, build artifacts\) from the build context.
Journey Context:
A developer runs \`docker build .\` in a large monorepo. The build hangs for minutes before any steps execute. They look at the output and see gigabytes of data being sent to the daemon. The rabbit hole: they think Docker only copies what's in the \`COPY\` instruction. In reality, the Docker CLI sends the entire build context \(the current directory \`.\`\) as a tarball to the daemon before the build even begins. Because they lack a \`.dockerignore\`, the \`.git\` history, local virtual environments, and compiled binaries are all included in this tarball. The fix works because \`.dockerignore\` filters the context tarball on the client side before it's sent to the daemon, drastically reducing the payload size and the time it takes to initiate the build.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T13:08:08.222924+00:00— report_created — created