Skip to content
Developer Guide

How to Free Up Docker Disk Space on Mac

Docker quietly consumes 10–50 GB on your Mac through dangling images, stale build cache layers, stopped containers, and forgotten volumes. Here is exactly how to find and reclaim it — with and without Terminal.

October 20266 min read

Why Docker uses so much disk space

Docker Desktop on macOS stores everything inside a large virtual disk image — typically at ~/Library/Containers/com.docker.docker/Data/vms/0/data/Docker.raw. This file can grow to 60 GB or more and almost never shrinks automatically, even when you delete containers and images inside Docker.

The four main culprits:

  • Dangling images — untagged layers left behind after rebuilds (<none>:<none>)
  • Build cache — BuildKit caches every intermediate layer, which accumulates rapidly across projects
  • Stopped containers — containers you ran once for testing and never removed
  • Unused volumes — named volumes attached to containers that no longer exist

Step 1 — Check how much Docker is using

Open Terminal and run:

docker system df

This shows a table with images, containers, local volumes, and build cache — including reclaimable sizes. Typical output on an active development machine shows 5–30 GB reclaimable.

Step 2 — Remove dangling images

Dangling images are untagged layers left over from rebuilds. They are always safe to delete:

docker image prune

To also remove all images not currently used by any container (including older versions of your own images):

# WARNING: removes all unused images, not just dangling ones
docker image prune -a

Step 3 — Remove stopped containers

List all containers including stopped ones:

docker ps -a

Remove all stopped containers:

docker container prune

Step 4 — Clear the build cache

Build cache is the biggest single source of reclaimed space. On active CI/CD setups it can exceed 20 GB:

docker builder prune

To remove all build cache without confirmation prompt:

docker builder prune --all --force

Step 5 — Remove unused volumes

Named volumes not attached to any running container are safe to prune. First, list them:

docker volume ls
docker volume prune

Step 6 — The nuclear option: docker system prune

To do everything above in one command:

docker system prune -a --volumes

⚠️ This removes ALL unused images, containers, volumes, and build cache. Running containers and their images are safe, but you will need to re-pull images the next time you run stopped projects.

The 1-click alternative: SpaceWise

SpaceWise's Docker Deep Cleaner connects to the local Docker Engine socket and categorises everything into safe vs. potentially-needed — without any Terminal commands. It shows dangling images, stopped containers, stale BuildKit layers, and unused volumes, letting you select exactly what to clean before confirming.

Unlike docker system prune -a, SpaceWise never removes base images referenced by active compose stacks or running containers, so it's safe to run on production-adjacent development machines.

Do all of this in SpaceWise — for free

SpaceWise scans and safely cleans everything covered in this guide with one click. No Terminal required.

Download for Mac Free