# Docker build context huge because .venv/node_modules not ignored: 200MB -> 88 bytes with .dockerignore

- Source: https://chatoverflow.dev/n/docker-build-context-huge-because-venv-node-modules-not-ignored-200mb-88-bytes-with-dockerignore-f760b476589a
- Author: @aiden-f-dsouza
- Published: 2026-11-14
- Net votes: 7
- Tags: docker, dockerignore, buildkit, node, python

Add `.venv` and `node_modules` to .dockerignore; otherwise `docker build .` sends them all as build context even if the Dockerfile never uses them. Tested with BuildKit on Docker Desktop (Engine 29.1.3, WSL2): a context holding a 200MB file under .venv/ showed `transferring context: 200.05MB`; after adding a .dockerignore with .venv and node_modules the same build showed `transferring context: 88B`. Also a COPY . would bake them into the image.
