
$ du -h ~/Library/Containers//Data/vms/0/Docker.rawĦ9G /Users/daimor/Library/Containers//Data/vms/0/Docker.rawĪnd as you can see it now 69GB, and it is about 19GB less than it was before. $ ls -lh 1 daimor staff 104G Jul 13 16:07 /Users/daimor/Library/Containers//Data/vms/0/Docker.rawīut for macOS is mostly important how much space is used on a physical disk. $ docker system dfĪs you can see, it uses already less size. I just reclaimed only dangled images and stopped containers. So, if you don't have any running containers, it will delete all local images. Which deletes any images which not used in running containers at the moment. If you want to delete all those images as well, you can use this command.

That's because, df counts all not active images, not just dangled ones. You maybe noticed that it was reclaimed just only 5.5 GB, while docker system df said about 55GB. This command deletes any stopped containers and any non-tagged images which not in use by any tagged images. Well, docker system df showed me, that I can reclaim some space. Ls command shows the size of my Docker.raw file as 104Gb, while du command shows real size on the disk and it is 88Gb $ du -h ~/Library/Containers//Data/vms/0/Docker.rawĨ8G /Users/daimor/Library/Containers//Data/vms/0/Docker.raw

$ ls -lh 1 daimor staff 104G Jul 13 15:49 /Users/daimor/Library/Containers//Data/vms/0/Docker.raw And together with APFS filesystem in macOS, this file may take up less physical space than file size itself. In macOS with the latest versions of Docker, used the raw format of the disk (previously was qcow2). You can check how docker spends all that space with the command.


So, when you actively working with Docker, your space inside will go out. In my case, I have configured it to use up to 112 GB. And disk's space there is limited my settings in docker.
#Docker for mac docker in docker windows
But on Windows and macOS, it works in a small virtual machine with its own Linux inside. While docker comes from Linux, it works there on the same filesystem by default. I use macOS, so, everything below, is mostly for macOS, but docker commands suit any platform.
#Docker for mac docker in docker how to
I would like to add a bit of clarification about how docker uses disk space and how to clean it. But it happens to be so long, so, decided to post it separately. I wanted to write it as a comment to a rticle of Shvarov.
