Skip to content

Instantly share code, notes, and snippets.

@qizhihere
Last active August 29, 2015 14:23
Show Gist options
  • Save qizhihere/9f6caad0034f1953c947 to your computer and use it in GitHub Desktop.
Save qizhihere/9f6caad0034f1953c947 to your computer and use it in GitHub Desktop.
export/import all docker images
# 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