Skip to content

Instantly share code, notes, and snippets.

@dangtrinhnt
Created October 14, 2017 06:29
Show Gist options
  • Save dangtrinhnt/24922c7a649c86b10c63187cfa7c1b5b to your computer and use it in GitHub Desktop.
Save dangtrinhnt/24922c7a649c86b10c63187cfa7c1b5b to your computer and use it in GitHub Desktop.
Pull all images from a private docker registry
#! /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