Created
July 2, 2020 08:06
-
-
Save xyb/8f0777fb9f313ae84a0b566ec64eb9b9 to your computer and use it in GitHub Desktop.
save docker image to a compressed tar ball
This file contains 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
#!/bin/sh | |
image="$1" | |
tarfile=$(echo "$image" | sed -e 's:/:--:g' -e 's/$/.tar/') | |
tgzfile=$(echo "$tarfile" | sed -e 's/$/.gz/') | |
docker save "$image" -o "$tarfile" | |
gzip "$tarfile" | |
echo "$image" saved to "$tgzfile" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment