Docker
Sep 19, 2025 4 min read

Fix Docker "no space left on device"

Reclaim disk used by dangling images, stopped containers, build cache and volumes.

Problem

Builds or `docker pull` fail with `no space left on device`, but `df -h /` looks fine.

Root cause

Docker stores images, containers, volumes and build cache under `/var/lib/docker`. Layers and BuildKit cache add up fast.

Solution

See what is using space

bash
docker system df -v

Prune safely

bash
docker container prune -f
docker image prune -af
docker builder prune -af

Remove unused volumes (DESTRUCTIVE — data is lost)

bash
docker volume prune -f

Frequently asked questions

Related fixes

Weekly digest

One DevOps fix in your inbox each week

Short, practical, no fluff. Real errors, real fixes — straight from production postmortems.