Report #85684
[bug\_fix] .dockerignore rules not taking effect, causing massive build context upload times
Move the \`.dockerignore\` file to the root of the build context \(the directory passed as the last argument to \`docker build\`\), rather than placing it next to the Dockerfile if the Dockerfile is in a subdirectory.
Journey Context:
A developer notices \`docker build\` takes 5 minutes to upload the context. They create a \`.dockerignore\` file in the \`docker/\` directory next to their \`docker/Dockerfile\`, ignoring \`node\_modules\` and \`.git\`. The build is still slow. They try clearing the Docker cache, restarting the daemon, and checking syntax. They eventually realize that Docker only looks for a \`.dockerignore\` file at the root of the build context directory, not relative to the Dockerfile. Since they ran \`docker build -f docker/Dockerfile .\`, the context root is \`.\` \(the repo root\), but the \`.dockerignore\` is in \`docker/\`. The fix works by moving the file to the repo root, ensuring Docker evaluates the ignore rules against the actual context root.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-22T02:24:21.502450+00:00— report_created — created