Skip to content

shrink docker for mac hyperkit vmdisk,docker for mac 辅助工具,导出contain和image重新生成虚拟机,以达到减少虚拟机硬盘占用的目的,现在docker on mac 可以自动shrink,用不着了,算是个小型的服务备份恢复工具

License

Notifications You must be signed in to change notification settings

cclient/ShrinkDockerForMac

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

shrink_docker_for_mac_hyperkit

shrink docker for mac hyperkit

it is problem of hyperkit not docker for mac

hyperkit didn't supperly shrink

if you need shrinks please use vmware and install vmwaretool even you can share the host filesystem to docker vm client and set docker lib fites to the host share path.

I try to shrink use du but the shrinked file didn't work。

by now

i think the only way to shrink is delete the Docker.qcow2 rebuild it and load older images and containers,like dump and load

so i write this python script

since docker export/import will lost containner's env and cann't restart containers, so commit to a new image and then start new containers depend it.

this script can restart container with current port but cann't resume the volumes

in order to avoid the unexpected i suggest do it manual

1 python shrink.py -t save

2 quit docker process and remove Docker.qcow2(rename to Docker.qcow2_back is better)

3 start docker process it will auto rebuild a new Docker.qcow2 file,wait it accomplish

4 python shrink.py -t load

5 remove the tmp file

About

shrink docker for mac hyperkit vmdisk,docker for mac 辅助工具,导出contain和image重新生成虚拟机,以达到减少虚拟机硬盘占用的目的,现在docker on mac 可以自动shrink,用不着了,算是个小型的服务备份恢复工具

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages