How do you get around the size limitation of Docker.qcow2 in the Docker for Mac? How do you get around the size limitation of Docker.qcow2 in the Docker for Mac? postgresql postgresql

How do you get around the size limitation of Docker.qcow2 in the Docker for Mac?


The following script delete and re-create a new shrinked Docker.qcow2 file preserving the images passed as arguments.

https://blog.mrtrustor.net/post/clean-docker-for-mac/

Hope this helps.


For a situation like this, I would definitely recommend creating a qcow image that can grow larger.

It is a relatively straightforward process, and you get the performance benefits that are generally quite necessary when running a large database.


Docker for Mac 18.06 switches from the qcow2 file format to the raw file format, which improves speed and disk usage. The core issue still persists, in that Docker has a limited amount of space that it can use for all of its data. However, you can now set what that limit is within Preferences -> Disk -> Disk image size.

Docker for Mac version 17.12 was the first version to introduce the raw file format, but there were some bugs in the initial release that caused them to remove it as a feature temporarily. You can search that page for 'raw' to look back through the feature's history.

There's a great note here about how Docker for Mac reports its disk usage...

This will display the logical size:

ls -alh ~/Library/Containers/com.docker.docker/Data/vms/0/Docker.raw

While this will display the physical size:

du -h ~/Library/Containers/com.docker.docker/Data/vms/0/Docker.raw