Last active
July 18, 2017 10:43
-
-
Save childnode/8f100f90b116271761a21979d4905887 to your computer and use it in GitHub Desktop.
dockerSaveAllImages.sh
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
#!/bin/bash | |
docker images | grep -v "^REPOSITORY"| awk '{print $1":"$2}' | tee -a scratch.$(date +%F).txt | |
for i in $(cat scratch.2017-07-18.txt); do echo docker pull $i; done > scratch.$(date +%F).restore.sh | |
echo -e "\n[DONE] For Restore please execute: scratch.$(date +%F).restore.sh" | |
chmod +x ./scratch.$(date +%F).restore.sh |
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
#!/bin/bash | |
for i in $(docker images -q); do | |
exportName=$(docker images | grep $i | awk '{print $1":"$2"@"$3}' | tr -c "[:alnum:][:blank:][:cntrl:]" _); | |
docker save -o $exportName.docker $i; | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
(i)
for i in $(docker images | grep -v ^REPOSITORY | awk '{print $1":"$2"@"$3}' | tr -c "[:alnum:][:blank:][:cntrl:]" _); do ls $i.docker; done
for i in *.docker; do docker load $i; done