Docker Community Forums

Share and learn in the Docker community.

Auto-shrinking Docker.qcow2?

First of all I want to say that Docker for Mac has been absolutely fantastic. I was in the beta and reported a few issues with networking, but it’s now all working very well for me, even when using OpenVPN.

There was some talk a little while back about adding some mechanism by which Docker would help you shrink the Docker.qcow2 image so that you could reclaim space. Is there any progress or plan to do this?

Not having this is a bit of a headache because new users often don’t realize that the Docker images can stay behind even after they quit their container unless they clean it up. Only when their hard drive is surprisingly full do they learn that they should have been deleting old images as they went along! Right now the only options for most users are to live with it or delete the whole thing and start over.

It doesn’t have to be automatic: this could be as simple as a menu option that zeros the free space, creates a new sparse image, then swaps them for you. This would probably be slow and require you to have a lot of free disk space, but this would at least give user some way forward that doesn’t involve learning a lot about virtual disks.

There is experimental TRIM support in Beta 32: