Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

DockerHub API - listing tags

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.

like image 383
itaysk Avatar asked Feb 18 '18 21:02

itaysk


People also ask

What are tags in Docker Hub?

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.

Where do I find docker tags?

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.

How do I list images in docker repository?

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.


1 Answers

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
like image 170
zoidberg Avatar answered Sep 29 '22 22:09

zoidberg