To clear Docker images and containers on a Mac, run docker system prune in Terminal for a safe cleanup, or docker system prune -a to remove all unused images when the drive is really tight. Run docker volume prune separately only if you're sure you don't need the stored data. Docker Desktop can quietly consume 50–100 GB once you've pulled a few base images and worked on a couple of projects — most of that is dangling images, stopped containers, and unused volumes.

TL;DR

  • docker system prune removes stopped containers, unused networks, dangling images, and dangling build cache.
  • docker system prune -a also removes every image not tied to a running container (expect to re-pull).
  • docker volume prune clears unused volumes — this is the one that can delete persistent data.
  • Volumes are never removed by the default prune, so databases stay safe.
  • A monthly docker system prune habit prevents the "why is my Mac full" moment later.

What's actually filling up your disk

Docker on Mac stores everything inside a single virtual disk image managed by Docker Desktop. Over time it accumulates several distinct kinds of bloat:

  • Dangling images — untagged layers left behind after rebuilds
  • Stopped containers — exited containers still holding their writable layer
  • Unused images — base and project images you no longer run
  • Build cache — intermediate layers from docker build
  • Unused volumes — persistent data from projects you've abandoned

Knowing which category is heaviest tells you which prune command to reach for. Check current usage anytime with docker system df, which breaks down space by images, containers, volumes, and build cache.

Prune commands compared

Command Removes Leaves alone When to use
docker system prune Stopped containers, unused networks, dangling images, dangling build cache Running containers, tagged images, all volumes Routine safe cleanup
docker system prune -a All of the above plus every image not tied to a running container Volumes Drive critically full; you have bandwidth to re-pull
docker volume prune Volumes not attached to any container Volumes still in use Only when you're sure the data is disposable
docker builder prune Build cache only Everything else Targeted build-cache cleanup

Step-by-step cleanup

Safe default prune

  1. Open Terminal.
  2. Run docker system prune.
  3. Confirm with y.

This removes stopped containers, unused networks, dangling images, and dangling build cache. Running containers and the images behind them are untouched.

Aggressive prune

  1. Run docker system prune -a.
  2. Confirm with y.

This removes every image not currently tied to a running container, not just dangling ones. Expect to re-pull base images next time you start a project — fine on good bandwidth, skip it if you're tethered or offline.

Volumes (not automatic)

  1. When you're certain an old project is dead, run docker volume prune.
  2. Confirm with y.

Docker only deletes volumes not attached to any container.

Is pruning Docker safe? What it won't delete

The default docker system prune is safe for active work: it never touches running containers, the images they depend on, or any volume. That's deliberate — volumes hold persistent data like database rows and uploaded files, so Docker leaves them alone unless you explicitly run docker volume prune. The one command to think twice about is docker volume prune, because an unused volume might still contain a database you care about. Before running it, list volumes with docker volume ls and confirm nothing important is detached. Images and containers, by contrast, are reproducible — you can always re-pull or rebuild them.

FAQ

What does docker system prune actually delete on Mac?

It deletes stopped containers, unused networks, dangling (untagged) images, and dangling build cache. It does not delete running containers, the images they use, or any volumes, so it's safe for routine cleanup.

Does pruning Docker delete my database data?

Not with the default command. Database data lives in volumes, and docker system prune never removes volumes. Only docker volume prune can delete unused volume data, so run that one only when you're sure the data is disposable.

How much disk space can clearing Docker free on a Mac?

It's common to recover tens of gigabytes — sometimes 50–100 GB — on a Mac that has built and rebuilt projects for a while, since dangling images and build cache accumulate quickly.

What's the difference between docker system prune and prune -a?

The default docker system prune removes only dangling images. Adding -a removes every image not tied to a running container, including tagged base images you'll need to re-pull later.

How do I check Docker's disk usage on Mac?

Run docker system df in Terminal. It shows a breakdown of space used by images, containers, local volumes, and build cache, with a reclaimable column so you can see what a prune would free.

If Docker is tidy and your Mac is still heavy, continue with how to clear Xcode cache and derived data and mysterious System Data on Mac: how to safely clean the disk. Video editors should also see how to clear the Final Cut Pro media cache and how to clear Adobe Premiere and After Effects media cache. If you also use Discord on desktop, read how to clear the Discord cache on PC. For a broader workflow, browse our content and data utilities hub. And when your phone is what's full, Cleanor clears caches, duplicates, and large videos locally on iOS and Android.