Docker.raw taking up space on Mac? Measure it before cleanup
Docker.raw is not a folder of disposable cache files. Docker Desktop stores its Linux environment in a disk image on your Mac. Before changing it, establish how much space is actually allocated, identify the Docker objects you no longer need, and protect anything that contains work or data.
This guide is for Docker Desktop on macOS. It is not a set of instructions for OrbStack, a remote Docker server or a production host.
Check the current disk-image location
Open Docker Desktop’s settings and inspect its storage controls under Resources. By default the image lives at ~/Library/Containers/com.docker.docker/Data/vms/0/data/Docker.raw, but the location can vary with your configuration, so trust the path your installed version shows.
To see how much space the file really uses on your Mac, compare its apparent size with its allocated size in Terminal:
ls -lh ~/Library/Containers/com.docker.docker/Data/vms/0/data/Docker.raw
du -h ~/Library/Containers/com.docker.docker/Data/vms/0/data/Docker.raw
The first number is the image's maximum size; the second is what it actually takes on disk. Finder usually shows the first, which is why Docker.raw can look far bigger than it is.
Docker’s Mac FAQ distinguishes a disk image’s maximum capacity from the space it currently consumes. A large apparent file size alone does not establish how much storage you can recover. The same documentation warns against moving the image directly in Finder.
Record the displayed current usage and your Mac’s available space. Keep those two readings separate: one describes Docker’s storage, the other the host volume.
Inventory before pruning
In a terminal connected to the intended local Docker environment, these commands inspect usage without asking Docker to remove objects:
docker context show
docker system df -v
docker container ls -a
docker image ls
First confirm the context is the local environment you meant to investigate. Then look at the object names and their purpose. A stopped container is not necessarily unwanted. It may contain a database, a test environment or changes that were never copied elsewhere.
Make three lists: keep, investigate, and remove. For an unfamiliar object, trace it to the project that created it. If you cannot explain what it contains, leave it in the investigate list.
Use targeted cleanup
Use Docker Desktop or Docker’s documented commands to remove only objects you have identified as unnecessary. Read the confirmation and check its scope. Broad cleanup commands can affect multiple projects, so they should not be the first response to a large storage number.
This article deliberately provides no one-line deletion command. The correct removal depends on your containers, images, volumes and backup arrangements. Docker’s pruning documentation explains those categories and the options that change the scope.
Avoid treating the whole disk image as a cleanup target. Replacing an environment is a migration or reset task, requiring its own recovery plan—not an ordinary cache clear.
Measure what happened afterward
Repeat the same Docker usage check, then compare available storage on the same Mac volume. Keep the time of each measurement. Do not promise yourself that an estimated reclaimable total will translate into an identical immediate increase in host free space.
If the difference is unexpected, consult the storage guidance for your installed Docker Desktop version before running broader operations. That is more useful than repeatedly deleting unrelated Mac caches.
Find out why it grows again
A useful record pairs measurements with ordinary work: a large image pull, a build, a restored database or a new development environment. Keep those events separate from conclusions. Growth after a build is a lead to investigate, not proof that every byte came from that build.
DiskFox’s storage history can help identify when measured storage increased. Use Docker itself to understand and manage objects inside its environment. DiskFox does not turn Docker.raw into a safely disposable file or replace Docker’s own controls.
For other development storage, see Xcode, Docker and package-cache cleanup. If you are choosing a tool to inspect your Mac first, see the disk space analyzer page.
Download the DiskFox trial to start a local storage baseline. Historical comparisons begin with recorded scans, and cleanup still requires your review.