解决 Mac Docker.qcow2 文件过大的问题
Author: ninehills
Labels: blog done
Created: 2017-07-13T02:21:52Z
Link and comments: https://github.com/ninehills/blog/issues/3
背景:Docker on Mac 长时间运行后,Docker.qcow2就会变得很大,需要压缩
参考:https://github.com/docker/for-mac/issues/371
Author: yankcrime NB: You’ll need to install qemu via Homebrew as this process requires qemu-img to recompress the qcow2 disk image.
|
|
除此之外,还有一个根本解决问题的方法,就是不要在虚拟机内保存任何数据,全部使用Volume,这样当文件过大时,删除文件,重启Docker后,重新创建容器即可。