Skip to content

Instantly share code, notes, and snippets.

@dreadjr
Forked from adampats/registry-images.sh
Created September 5, 2018 16:06
Show Gist options
  • Save dreadjr/916fa5f1f149e75567f17455df4f1958 to your computer and use it in GitHub Desktop.
Save dreadjr/916fa5f1f149e75567f17455df4f1958 to your computer and use it in GitHub Desktop.
Docker Registry v2 API list images and tags
# Assumes htpass authentication
registry_server='docker.mycloud.com'
username='bob'
# List all images (i.e. repositories)
curl -k -X GET "https://$registry_server/v2/_catalog" -u $username -H "Accept: application/json"
Enter host password for user 'bob':
{"repositories":["app-base","ubuntu","cache-base"]}
# Get all tags (versions) for a given image
image='app-base'
curl -k -X GET "https://$registry_server/v2/$image/tags/list" -u $username -H "Accept: application/json"
Enter host password for user 'bob':
{"name":"app-base","tags":["v3","latest","v4","v1","v2","v5"]}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment