How to list images in docker registry being on registry server?

11,395

The docker CLI doesn't have functionality to search a registry, but you can use the registry's REST API. Assuming you're using the registry:2 image, then you can list all the repositories using the catalog endpoint:

curl https://my-registry:5000/v2/_catalog                      
{"repositories":["busybox","redis","ubuntu"]}

And then you can query the tags for a repository:

curl https://my-registry:5000/v2/busybox/tags/list             
{"name":"busybox","tags":["2","latest"]}

Here's the full Registry API spec.

Share:
11,395
h__
Author by

h__

Updated on June 14, 2022

Comments

  • h__
    h__ about 2 years

    Currently I'm pushing images from one machine to another. The success of it I can determine base on HTTP status from pushing machine or base on logs from the registry server. At this point I want to search through what really is in my registry on my server. What I found till now is the API calls from outside and that if even when you call it you have to know exact name of the image and how it is tagged. In my case, I want just to enlist what images currently are in my registry when I have direct access to it. I did not find any related command.

  • Eugene
    Eugene over 2 years
    coming from a helm chart world, this "The docker CLI doesn't have functionality to search a registry" keeps popping to me once in a while and every time it does, I am in pain