I have Docker installed on my Mac OS Catalina and recently found very big file Docker.raw. It is 64 Gb. Is it really needed? And if so, why is it so big ?
-
It's not a macOS file, doesn't have anything to do with macOS. Ask whoever packaged the Docker you're using.– Marc WilsonMay 19, 2020 at 13:14
-
This is mostly caused by unsupervised training sessions. After ending up containerization trainings, people (for example: me) forget to clean up the newly created volumes and containers. I don't know if your situation is related to what I've experienced, but doing the mistake that I mentioned above, I ended up finding your question here and others might do the same. So, another option apart from the accepted answer would be checking the unused containers,images and volumes. Because directly reducing the disk image use wipes out all images, containers and volumes as docker warns.– Burak KarakuşMay 21, 2022 at 23:06
-
The physical size is NOT 64 GB unless your containers and images are actually that big. To confirm, you can check the size on disk by – Right click on the file then click "Get Info"– Izhar AazmiNov 17, 2022 at 20:23
4 Answers
Docker for Mac stores Linux containers and images in a single, large file named Docker.raw. To reduce its size, after having pruned the unused docker objects ( https://docs.docker.com/config/pruning/ ), open the Docker Desktop preferences, and then under 'Resources' -> 'Advanced' -> 'Disk image size':
You can reduced file to less than 64GB. it's telling you how much is currently used by the current data. Also Resizing to a smaller size will delete the disk image; all Docker images / containers will be lost. Other settings will be preserved.
The answer to your question is in the Docker documentation:
Disk utilization in Docker for Mac
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.
The size of this file is big in your system because you have a lot of images and containers. You can reduce its site by pruning unused objects.
-
4nope, the Docker.raw file has a fixed size on Mac OS, which is set in the preferences, and AFAIK the default size is 64GB on a 512G Macbook, and 32G on a 256G Macbook, which you can manually set it to a minimum of 8G I think, and it will take up that much disk space despite whether you have any images and containers or not. Aug 28, 2022 at 6:38
The easiest way to reduce Docker.raw file size is by setting the preferences, as Docker official page states:
Select the Docker icon and then select Preferences > Resources > Advanced.
If you've tried pruning everything but still cannot get your disk usage back to normal, there is a utility in docker desktop in the Troubleshoot
menu, which you can get to by clicking the little bug icon in the menu bar. Running the Clean / Purge data
utility fixed this for me.
-
-
Instruction that was selected as answer explains how to limit the size available for docker images, this shows a way how to clean docker data. May 30 at 21:52