wanliqun / macos_docker_toolkit

mac os toolkit

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

macos_docker_toolkit

mac os toolkit

As a developer, I use docker to do my development work a lot on my Mac Air laptop. It's quite annoying that once I pulled some docker images and kicked off some docker containers, the consuming disk space keeps growing even after I try to delete some files to free some space.

So I googled around, then based on the following references, I write some shell scripts to work it out. It did work for me, and I hope it work for you too.

docker_regen.sh

This script will backup your docker images to tar archive files, then delete docker's single writable disk imageDocker.raw (or Docker.qcow2), and finally restore the docker images from the previous backup files (and optionally remove the backup files). You can change the docker preference settings to adjust the maximum docker image size during the process.

docker_reclaim.sh

This script will do a docker system prune, then trim & reclaim the docker disk image size, and output the pre-reclaim & post -reclaim disk space usage.

docker_retag.sh

This script will re-tag the docker image from image id after restoring the docker images from backup file.

About

mac os toolkit

License:MIT License


Languages

Language:Shell 100.0%