Skip to content

Instantly share code, notes, and snippets.

View aharonh's full-sized avatar

Aharon Haravon aharonh

View GitHub Profile
@aharonh
aharonh / backup-all-docker-images.sh
Created February 17, 2018 14:04 — forked from jrenggli/backup-all-docker-images.sh
Backup/Save all Docker Images to a compressed file
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