Forked from mathewdgardner/docker-save-load-images.sh
Last active
September 19, 2019 02:31
-
-
Save kebyn/1d394b5b1187c49dbdc55d685f3c26fa to your computer and use it in GitHub Desktop.
Save / load compressed 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
#!/bin/bash | |
# Save docker images | |
ds() { | |
docker images --format {{.Repository}}:{{.Tag}} | xargs -t -n 1 -I {} -P 4 sh -c 'docker save {} > $(echo "{}" | sed "s/^.*\///").tar.gz' | |
} | |
# Load docker images | |
dl() { | |
ls *.tar.gz | xargs -t -n 1 -I {} -P 4 sh -c 'docker load -i {}' | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment