Skip to content

Instantly share code, notes, and snippets.

View chengdh's full-sized avatar

chengdh

  • 中国郑州
View GitHub Profile
@chengdh
chengdh / gist:07a30b75af658208550cdefc58906bb1
Created May 25, 2017 09:08 — forked from jcataluna/gist:1dc2f31694a1c301ab34dac9ccb385ea
Script to save all images from a docker-compose.yml file
#!/bin/bash
mkdir -p out
for img in `grep image $1| sed -e 's/^.*image\: //g'`;
do
cleanname=${img/\//-}
tag=`docker images | grep $img | awk '{print $2}'`
echo "Exporting image: $img, tag:$tag ($cleanname)..."
docker save $img -o out/$cleanname.tar