Docker Registry: Fetching docker image tags with created time and digest

I want to fetch docker image tags for a particular image along with its metadata like created time and digest.

I found 2 methods for doing the same:

  1. Using the Docker Registry API for getting all the tags /v2/{imageName}/tags/list (in lexically sorted order) and calling the manifest API for each individual tag /v2/{imageName}/manifests/{tag} But we have a lot of tags and making an HTTP call for each tag can be really expensive.
  2. Using this API which seems to either be an internal API of Docker Hub or part of Docker Trusted Registry API:{imageName}/tags/?page_size=100&page=1&ordering=last_updated

Is the second API part of some spec (Docker Registry API) or is it just an internal API for Docker Hub which can be changed at any point without any notice? And is there a way to expose this API from a private/on-prem Docker Registry installation.

Finally, how can I get metadata (created time and digest) for each tag efficiently without having to make so many HTTP requests?

submitted by /u/gpahal
[link] [comments]
Source: Reddit