I'm trying to get the list of tags for a public image in DockerHub.
I found the following example which works:
https://hub.docker.com/v2/repositories/${reposiroty}/tags
but it's paged, and I need to control the page size and I can't find documentation on this API. It says v2 in the URL, but it does not look like the V2 spec, neither like v1. The registry v2 spec seems to require authentication which i'm not interested in because I only query public data. https://docs.docker.com/registry/spec/api/
So if someone knows how to get the entire list of tags in one request from Docker Hub, please share. Also if Someone can shed some light on the poorly documented Docker Hub API, it'll help.
Docker tags are mutable named references to Docker images, much like branch refs in Git. They make it easy to pull and run images, and for image authors to roll out updates automatically.
The most recent version of docker-tags can be found in my GitHubGist : "List Docker Image Tags using bash". The docker-tags function has a dependency on jq. If you're playing with JSON, you likely already have it.
To list the images in a local repository (not the registry) run: docker image ls The list will contain the image repository name, a tag for the image, and an image ID, when it was created and its virtual size. Columns: REPOSITORY, TAG, IMAGE ID, CREATED, and SIZE.
You can add the query parameter page_size=X
to determine how many tags will be displayed. It won't automatically give you every tag, but you can set it to a really big number to ensure you get what you want.
https://hub.docker.com/v2/repositories/library/ubuntu/tags?page_size=1000
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With