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

大城市里の小女人 提交于 2019-11-30 06:10:30

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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!