Why Docker uses so much disk space on a Mac
Docker Desktop keeps containers and images in one disk image file. Here is how to find it, read its real size, see what fills it, and free space without losing a volume. Every step from Docker's and Apple's own documentation.
One file holds it all
Docker's documentation: "Docker Desktop stores Linux containers and images in a single, large "disk image" file in the Mac filesystem. This is different from Docker on Linux, which usually stores containers and images in the /var/lib/docker directory." (Docker Desktop for Mac FAQ)
So on a Mac, Docker's containers and images do not show up as folders you can open. They show up as one file.
Find the file
In Docker Desktop, open Settings, then Resources, then Advanced. Docker says this tab "displays the location of the disk image. It also displays the maximum size of the disk image and the actual space the disk image is consuming."
Docker's own example puts it here:
~/Library/Containers/com.docker.docker/Data/vms/0/data/Docker.rawRead its real size, not its maximum
Docker warns: "Note that many tools report the maximum file size, not the actual file size." To see the actual size, Docker gives this:
cd ~/Library/Containers/com.docker.docker/Data/vms/0/data
ls -klsh Docker.rawThe first number is the space the file really uses, in KB. The size later on the line is the maximum.
Why the two differ: Docker.raw is a sparse file. Apple's documentation on APFS: "on-disk blocks are allocated only when those blocks are actually written to. This behavior lets files that contain blank sections, such as disk images and database dumps, be saved on disk more efficiently." (About Apple File System)
See what fills it
docker system df -vDocker: "You can see the detailed space usage information by running" this. docker image ls lists images and docker container ls -a lists containers, stopped ones included.
Free space, least risk first
- Prune what nothing uses. First, Docker's own words: this "removes all stopped containers". So list them before you run it, with
docker container ls -a, and keep any you still need.docker container ls -a docker system pruneDocker: it "removes all stopped containers, unused networks, dangling images, and build cache." Its pruning guide adds: "Volumes aren't pruned by default." (Prune unused Docker objects)
- Remove images you no longer use, after checking the list from
docker image ls. Docker: "Space is only freed when images are deleted. Space is not freed automatically when files are deleted inside running containers." - Move the disk image to a bigger drive, in Settings, Resources, Advanced, Disk image location. Docker: "Do not move the file directly in Finder as this can cause Docker Desktop to lose track of the file."
- Lower the maximum size only if you can lose everything inside. Docker: "When you reduce the maximum size, the current disk image file is deleted, and therefore, all containers and images are lost."
Leave volumes alone unless you know what they hold
Docker: "Volumes are never removed automatically, because to do so could destroy data." docker system prune --volumes removes unused anonymous volumes; named unused volumes are left alone unless you run docker volume prune --all (Docker's pruning guide). Know what each volume holds before you run either.
Sources
- FAQs for Docker Desktop for Mac, Docker, read 3 Nov 2026 (from github.com/docker/docs).
- Prune unused Docker objects, Docker, read 3 Nov 2026 (from github.com/docker/docs).
- About Apple File System, Apple Developer Documentation, read 3 Nov 2026.