Created
March 1, 2016 02:55
-
-
Save mathewdgardner/b8b834b9d94da898b5df 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 | \ | |
cut -d ' ' -f 1 | \ | |
tail -n +2 | \ | |
xargs -t -n 1 -I {} -P 4 \ | |
sh -c 'docker save {} | bzip2 > $(echo "{}" | sed "s/^.*\///").tar.bz2' | |
} | |
# Load docker images | |
dl() { | |
ls *.bz2 | \ | |
xargs -t -n 1 -I {} -P 4 \ | |
sh -c 'bzip2 -dc {} | docker load' | |
} |
kebyn
commented
Sep 6, 2019
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment