0

It looks like to me that when those repositories under hub.docker.com, I can use them directly by name. Let say, ubuntu. I can use it in file Dockerfile directly by "FROM ubuntu:latest", and can know any tags other than latest in the link https://hub.docker.com/_/ubuntu?tab=tags

But when it comes to repo not under hub.docker.com. Take Microsoft sdk as an example. It is under mcr.microsoft.com/dotnet/sdk (https://github.com/microsoft/containerregistry). I cannot use the same way as above to know what is the available tags. Instead, I need to read the "Readme.md" there and then I know the way to query the tags is by the link https://mcr.microsoft.com/v2/dotnet/sdk/tags/list.

Is there any universal way to browse the repositories and the available tags for a specific repositories?

kzfid
  • 688
  • 3
  • 10
  • 17

1 Answers1

1

For example, if you have a registry at location: registry.example.com:5000 and HTTPS proxy, you could use the address: https://registry.example.com:5000/v2/_catalog to list all repositories.

Similarly for tags at https://registry.example.com:5000/v2/<repo_name>/tags/list

References:
https://docs.docker.com/registry/spec/api/#listing-repositories https://docs.docker.com/registry/spec/api/#listing-image-tags

Tharun K
  • 1,160
  • 1
  • 7
  • 20
  • Thanks, it seems it is something I am looking for. The one in MS seems matched with what you say. That is, "https://mcr.microsoft.com/v2/_catalog" tells what image repo available and "https://mcr.microsoft.com/v2/dotnet/sdk/tags/list" tells what tags available for a specific image repo (dotnet sdk in this case). But I cannot do it for "https://hub.docker.com/". "https://hub.docker.com/v2/_catalog" returns 404 - page not found error. Is there something I am missing or it is a different standard? – kzfid May 06 '22 at 04:04
  • The official Docker Hub registry does not implement the `_catalog` API, more info here: https://stackoverflow.com/a/68654659/11848685 – Tharun K May 06 '22 at 05:49
  • Weird, v2/_catalog is mentioned here (https://docs.docker.com/registry/spec/api/). But its official docker Hub does not support it. – kzfid May 06 '22 at 06:13