Last active
August 29, 2015 14:23
-
-
Save qizhihere/9f6caad0034f1953c947 to your computer and use it in GitHub Desktop.
export/import all docker images
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
# export all images to current directory | |
for i in $(sudo docker images | sed -n "2,\$p" | awk '{print $1":"$2}'); do | |
sudo docker save $i > $(echo -n $i | tr '/' '_').tar | |
done | |
# import all images from current directory | |
for i in $(ls *.tar); do sudo docker load < $i; done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment