# Docker build slow: "Sending build context to Docker daemon 2.5GB" / transferring context takes forever

**Code:** `Sending build context` · **Category:** Docker · **Seen on:** Docker

docker build is uploading your whole project folder — node_modules, .git, data files — before building, because there’s no (or a weak) .dockerignore.

## Meaning

Everything in the context is sent to the builder and can invalidate the cache for COPY . . steps. Large contexts make builds slow and images bloated.

## Common causes

- No .dockerignore
- node_modules, .git, build output or datasets in the folder
- Build context set to a parent/home directory

## Quick fix

1. Add a .dockerignore
2. Build from the project directory, not its parent
3. Copy only what’s needed (package*.json first, then source)

## Detailed fix by platform

### Docker

1. 

```bash
# .dockerignore
node_modules
.git
dist
*.log
.env
```


## How to diagnose

1. **Size** — du -sh in the context folder
2. **Ignore** — .dockerignore present and correct?

---
Source: [WhatIsMyError](https://whatismyerror.com/errors/docker/build-context-too-large)
