Skip to content

Instantly share code, notes, and snippets.

@artsok
Last active August 30, 2019 16:07
Show Gist options
  • Save artsok/c076aad9c1043246b068fc24fccd68d2 to your computer and use it in GitHub Desktop.
Save artsok/c076aad9c1043246b068fc24fccd68d2 to your computer and use it in GitHub Desktop.
save reportportal docker images to localhost
#!/bin/bash
declare -a arr=("consul" "service-authorization" "traefik" "service-index" "service-api" "service-ui" "elasticsearch-oss" "service-analyzer" "service-jira" "service-rally")
for name in "${arr[@]}"
do
imagesName=($(docker images | grep $name | awk '{print $1}'))
tag=($(docker images | grep $name | awk '{print $2}'))
imagesId=($(docker images | grep $name | awk '{print $3}'))
echo "$name - $tag - $imagesId"
docker save $imagesId -o "$name-$tag".tar
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment