Skip to content

Instantly share code, notes, and snippets.

@asaf400
Last active July 9, 2016 14:24
Show Gist options
  • Save asaf400/2c6f90bb278255adb6058738c5715274 to your computer and use it in GitHub Desktop.
Save asaf400/2c6f90bb278255adb6058738c5715274 to your computer and use it in GitHub Desktop.
#!/bin/bash
for image in $1; do
IFS='/' read -ra ADDR <<< "$image"
len=${#ADDR[@]}
#echo $(expr $len - 1)
file=${ADDR[$(expr $len - 1)]}
echo Docker Working on $file..
docker save $image > "$file.tar"
echo ///////
done;
echo Compressing Files..
7za a -t7z -m0=lzma2 -mx=9 -mfb=64 -md=64m -sdel -v400m newimages.7z *tar
# Doesnt work because 7z doesn't suport multi volume updates..
echo Removing temporary file $file.
rm -rf *tar
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment