Skip to content

Instantly share code, notes, and snippets.

@froulet
Last active June 21, 2018 19:31
Show Gist options
  • Save froulet/57523fa73be03b33134841e2132ee323 to your computer and use it in GitHub Desktop.
Save froulet/57523fa73be03b33134841e2132ee323 to your computer and use it in GitHub Desktop.
Bash script to save all images used in a docker-compose.yml file
#!/usr/bin/env bash
for img in $(docker-compose images | tail -n +3 | awk '{print $2 ":" $3}'); do
echo "Saving $img ...";
images="$images $img"
done
docker save -o services.img $images
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment