How to shrink Docker's disk image on a Mac and reclaim the space
Docker Desktop on macOS stores all images, containers, volumes and build cache in a single disk image file, Docker.raw, which appears as one large file to macOS. The file's on-disk usage can be checked with ls, and Docker Desktop's settings show the same information, while docker system df breaks down what occupies the space. Running docker system prune removes stopped containers, unused networks, dangling images and build cache, and adding -a also removes unused images that can be re-downloaded later. Volumes are not removed by pruning, and the space may take a few minutes to appear as free, or can be reclaimed immediately with a dedicated docker run command. The article also advises lowering the image size limit in settings only after pruning and if the contents can be rebuilt.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.
Discussion (0)
Log in to join the discussion and vote.
Log in