Skip to content

Instantly share code, notes, and snippets.

@adampats
Created October 22, 2015 05:59
Show Gist options
  • Save adampats/c5f3b7a7ee61b0d24cc3 to your computer and use it in GitHub Desktop.
Save adampats/c5f3b7a7ee61b0d24cc3 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