Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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.

like image 327
h__ Avatar asked Oct 17 '25 03:10

h__


1 Answers

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.

like image 81
Elton Stoneman Avatar answered Oct 18 '25 21:10

Elton Stoneman