Skip to content

Instantly share code, notes, and snippets.

@shzaur
Created February 17, 2019 23:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save shzaur/08340241d57a3b294b8f4cbcc8cca2b4 to your computer and use it in GitHub Desktop.
Save shzaur/08340241d57a3b294b8f4cbcc8cca2b4 to your computer and use it in GitHub Desktop.
Save all images from a docker-compose.yml
#!/bin/bash
# https://gist.github.com/jcataluna/1dc2f31694a1c301ab34dac9ccb385ea#gistcomment-2222429
for img in $(docker-compose config | awk '{if ($1 == "image:") print $2;}'); do
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