Last active
April 11, 2022 09:22
-
-
Save qwadro/f59baf62fc7aff6eb8e738b8af636211 to your computer and use it in GitHub Desktop.
save docker images as separated files
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
| for a in $(docker images | awk '{ print $1 "?" $2 }' | grep -v REPOSITORY ) | |
| do | |
| name=$(echo $a | cut -d? -f1) | |
| version=$(echo $a | cut -d? -f2) | |
| shortname=${name##*/} | |
| echo exporting docker image: $name with version $version | |
| docker save $name:$version | gzip > "$shortname"_"$version".tar.gz | |
| echo $shortname=$version >> ../versions.txt | |
| done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment