Created
October 14, 2017 06:29
-
-
Save dangtrinhnt/24922c7a649c86b10c63187cfa7c1b5b to your computer and use it in GitHub Desktop.
Pull all images from a private docker registry
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 | |
username='' | |
passwd='' | |
docker_registry_url='' | |
tag='' | |
docker login -u $username -p $passwd $docker_registry_url | |
curl "https://$username:$passwd@$docker_registry_url/v2/_catalog" | jq -c '.[][]' | while read images; do | |
for i in $images | |
do | |
img=$(echo $i | tr -d '"') | |
img_url=$(echo "$docker_registry_url/$img:$tag") | |
echo "Pulling image $img_url" | |
docker pull $img_url | |
done | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment