Coffee
← Blog Mac Productivity

Docker Using Too Much Disk Space on Mac? Fix Docker.raw

By FavTray ·

Written by the team behind FavTray, a Mac developer dashboard for the menu bar. We check every app we cover against its own site, docs or a hands-on test, and each post says which.

Short answer: Docker Desktop keeps every image, container, volume and build cache in one disk image, Docker.raw, and it grows until you prune. Run docker system df to see what’s using it (read-only). Free space with docker image prune, docker builder prune or docker system prune, then cap the size in Settings › Resources › Advanced. Never delete Docker.raw by hand.

TL;DR

  • Measure first (read-only): docker system df -v and ls -klsh on Docker.raw.
  • Safe wins: build cache and dangling images come back the next time you build.
  • Think first: -a removes every image not in use; --volumes removes data.
  • Cap it: Settings › Resources › Advanced › Disk usage limit. Lowering it can wipe the disk image, so prune first.
  • Never delete or move Docker.raw in Finder.
  • OrbStack and Colima keep their own disk images and reclaim space differently.

Why does Docker take so much space on a Mac?

Containers need a Linux kernel, and macOS isn’t Linux. So Docker Desktop runs a small Linux virtual machine, and everything that machine stores lives in one disk image file on your Mac. According to Docker’s Mac FAQ, that file is:

~/Library/Containers/com.docker.docker/Data/vms/0/data/Docker.raw

Every docker pull, every docker build, every container you leave stopped and every volume you create adds to it. Nothing leaves until you remove it from inside Docker. Over months of switching projects, the usual result is gigabytes of:

WhatWhy it piles upComes back?
ImagesEvery tag you’ve pulled or built, including old versionsPull or build again
Build cacheBuildKit layers from every docker buildRebuilds on the next build
Stopped containersdocker run without --rm leaves them behindRecreate from the image
VolumesDatabases, uploads, anything you mountedNo. This is your data

macOS’s Storage settings usually file the disk image under System Data or Developer, which is why it’s easy to miss. If you’re not sure Docker is the problem, what’s eating your Mac’s disk covers the other usual suspects.

How much space is Docker really using?

There are two numbers: the limit (how big the disk image is allowed to get) and the actual space it occupies. Docker.raw is a sparse file, so tools that show the apparent size can report the limit instead of the real usage. That’s why Finder sometimes shows 64 GB when Docker is using much less.

Three ways to see the real number:

  1. Docker Desktop: open Settings (from the whale menu or the Settings icon in the Dashboard), then Resources › Advanced. Docker’s docs say this tab shows the disk image location and the disk usage limit.
  2. Terminal, Docker’s way (read-only):
    cd ~/Library/Containers/com.docker.docker/Data/vms/0/data
    ls -klsh Docker.raw
    The first number is the space really used; the size column further along is the maximum.
  3. Terminal, du (read-only): du -sh ~/Library/Containers/com.docker.docker counts allocated blocks, so it reports real usage too.

If your disk image lives somewhere else (you can move it), Settings › Resources › Advanced shows the path.

What’s inside the Docker disk image?

Ask Docker. This only reads:

docker system df

You get one row each for images, containers, local volumes and build cache, with TOTAL, ACTIVE, SIZE and RECLAIMABLE columns. Reclaimable is the number that matters: space held by things nothing is using.

For a per-item breakdown:

docker system df -v          # every image, container and volume with its size
docker image ls              # images, with sizes
docker container ls -a       # all containers, including stopped ones
docker volume ls             # volumes (sizes are in system df -v)

In docker system df -v, an image’s SHARED SIZE is layers it shares with other images. Deleting one image frees only its UNIQUE SIZE, which is why removing a big image sometimes frees less than you expected.

How do I free up Docker disk space safely?

Work from the safest to the most destructive, and check docker system df between steps. Every prune command lists what it will remove and asks for confirmation unless you add -f. Don’t add -f while you’re learning what they do.

  1. Remove build cache. It rebuilds on the next build, so this is usually the biggest safe win.

    docker builder prune

    This removes dangling build cache. docker builder prune --all removes all unused build cache, not just dangling layers, so your next build of every project starts cold.

  2. Remove stopped containers. Check the list first with docker container ls -a; a stopped container may hold changes you never committed to an image.

    docker container prune
  3. Remove dangling images (untagged layers left behind when you rebuild a tag):

    docker image prune
  4. Remove unused images, if you’re happy to pull them again:

    docker image prune -a

    This removes every image not used by at least one container, including base images you’ll need again tomorrow. On a slow connection that’s a real cost.

  5. Volumes: only on purpose. Volumes hold data: Postgres and MySQL databases, Redis dumps, uploaded files. List them, and remove the ones you recognise as throwaway by name:

    docker volume ls
    docker volume rm <volume-name>

    docker volume prune removes unused anonymous volumes by default, and docker volume prune -a removes unused named volumes too. Per Docker’s pruning docs, named volumes are kept unless you add -a. If one of those named volumes is a database you haven’t started this week, it’s gone.

What does docker system prune remove?

docker system prune does several of the above at once. Here’s what each form removes, from Docker’s docs:

CommandRemovesKeeps
docker system pruneStopped containers, unused networks, dangling images, unused build cacheTagged images, all volumes
docker system prune -aAll of the above, plus every image not used by a containerVolumes
docker system prune --volumesThe default set, plus unused anonymous volumesTagged images, named volumes

Read the summary it prints before you type y.

Why didn’t the space come back after I pruned?

Two reasons. First, the freed space inside the VM isn’t handed back to macOS instantly; Docker’s Mac FAQ says it can take a few minutes. You can trigger it yourself:

docker run --privileged --pid=host docker/desktop-reclaim-space

Second, you may have removed things that shared most of their layers with images you kept, so less was actually freed. docker system df -v shows shared versus unique size.

Then check again with ls -klsh Docker.raw or in Settings › Resources › Advanced.

How do I stop Docker from filling my disk?

Set a disk usage limit. In Docker Desktop, open Settings › Resources › Advanced and set Disk usage limit, which Docker’s settings docs describe as the maximum disk space the engine can use. Click Apply.

Before you lower it, back up anything you need. Docker’s Mac FAQ warns that reducing the maximum size deletes the current disk image, so every container and image is lost. Prune first, push or save images you can’t rebuild, and dump any database volumes you care about.

Other habits that help:

  • Run throwaway containers with docker run --rm so they delete themselves on exit.
  • Run docker builder prune every few weeks if you build often.
  • Use docker compose down when you’re done with a project (add -v only if you also want its volumes gone).

Can I move the Docker disk image to an external drive?

Yes, from inside Docker Desktop:

  1. Open Settings › Resources › Advanced.
  2. Under Disk image location, click Browse and choose a folder on the other drive.
  3. Click Apply.

Don’t move Docker.raw in Finder. Docker’s docs warn that Docker Desktop can lose track of the file. Keep in mind that containers on an external drive only work while it’s plugged in.

What’s the nuclear option?

If you don’t need anything in Docker and just want the space back: click the whale icon in the menu bar, choose Troubleshoot, then Clean up data. Per Docker’s troubleshooting docs, it destroys all local containers and images and keeps your settings. Treat it like formatting a drive. Reset to factory defaults, on the same screen, goes further and resets every setting too.

What about OrbStack and Colima?

OrbStack keeps its containers, images, volumes and Linux machines in a sparse disk image, data.img. OrbStack’s FAQ says it shows as 8 TB but only takes the space you use, and shrinks automatically when you delete data. The data lives in ~/Library/Group Containers/HUAQ24HBR6.dev.orbstack/data. Check the real size (read-only) with:

du -sh ~/Library/Group\ Containers/HUAQ24HBR6.dev.orbstack/data
docker system df

The same docker ... prune commands work against OrbStack, because it provides the Docker engine.

Colima runs Docker inside a Lima VM, configured in ~/.colima/default/colima.yaml. Colima’s FAQ says:

  • The disk size comes from disk: in that file and grows on the next start if you raise it.
  • Since v0.5.0, unused space in the VM is released on startup, so a colima restart after pruning gives it back. To do it without a restart: colima ssh -- sudo fstrim -a.
  • colima delete --data removes everything, including container data. That’s the Colima equivalent of the nuclear option.

How does FavTray Space help?

We make FavTray, so weigh our take accordingly.

FavTray Space maps your whole disk read-only, and its rules recognise the Docker, OrbStack, Colima and Podman disk images by name, so they show up as Docker rather than a nameless block in System Data. It files the Docker disk image as “can’t be replaced”, because it holds your volumes, and Worth a look never offers it. Select it and “Where to clear it” opens Docker Desktop or OrbStack with the menu path, so you prune from inside, the safe way. Space never deletes, moves or changes a file, and never runs a command.

History also shows what grew this week, so you can see if Docker is the thing that gained 20 GB since Monday. Space is part of FavTray Pro, $4.99 once, with a 7-day trial; Free shows your capacity and the recoverable total. If you’re mapping the whole disk, compare it with the best disk space analyzers for Mac.

And when the problem is a container hogging a port rather than disk, see how to kill port 3000 on a Mac.

Try FavTray Free

One free Mac menu bar app: notch island, ports, keep-awake, clipboard, eye rest, and Claude and Codex limits.

Download Free

Frequently Asked Questions

Why is Docker using so much disk space on my Mac?

Docker Desktop runs Linux in a virtual machine and keeps every image, container, volume and build cache inside one disk image file, Docker.raw. Images and build cache pile up with every pull and build until you prune them. Run docker system df to see the split; it only reads.

Is it safe to delete Docker.raw?

No, not to save space. Docker.raw holds all your images, containers and volumes, including any databases you run in Docker. Delete unused data from inside Docker with the prune commands instead. If you really want a clean slate, use Troubleshoot › Clean up data in Docker Desktop, knowing it destroys all local containers and images.

Why is Docker.raw 64 GB in Finder when Docker uses less?

Docker.raw is a sparse file. Finder and ls -lh can show its maximum size, while the space it really uses on disk is smaller. Docker's docs suggest ls -klsh Docker.raw to see the actual size. Settings › Resources › Advanced in Docker Desktop shows the disk image location and the disk usage limit.

What does docker system prune delete?

By default: stopped containers, unused networks, dangling images and unused build cache. Volumes are kept. Adding -a also removes every image not used by a container, and --volumes also removes unused anonymous volumes. It asks for confirmation unless you pass -f, so read the list it prints first.

Why didn't my disk space come back after pruning?

Docker Desktop may take a few minutes to release freed space back to macOS. Docker's Mac FAQ says you can trigger it with docker run --privileged --pid=host docker/desktop-reclaim-space. Check again with ls -klsh on Docker.raw, or in Settings › Resources › Advanced.

Does OrbStack use less disk space than Docker Desktop?

OrbStack also stores data in one sparse disk image, which shows as 8 TB but only takes what you use. Its docs say it shrinks automatically when you delete data inside it. You still need to prune images and build cache there, because the image holds whatever your containers keep.