-
-
Save aharonh/328426c0380fd9a5a7476c1a3e22c02f to your computer and use it in GitHub Desktop.
Backup/Save all Docker Images to a compressed file
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
docker images | tail -n +2 | grep -v "none" | awk '{printf("%s:%s\n", $1, $2)}' | while read IMAGE; do | |
echo $IMAGE | |
filename="${IMAGE//\//-}" | |
filename="${filename//:/-}.docker-image.gz" | |
docker save ${IMAGE} | pigz --stdout --best > $filename | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment