Docker Community Forums

Share and learn in the Docker community.

How to list all images in a local registry without knowing the namespaces?


(Ben Zhou) #1

if I know the namespace of an image, I can get a list of all tags with the curl command below:
curl -v -X GET http://erdbeer:5000/v2/imgNs/tags/list

But how can I list the available namespaces of images in a registry if I don’t know what images are there?


Docker command to list registry
(Bryce Ryan) #2

You may want to have a look here
https://docs.docker.com/v1.8/registry/spec/api/#listing-repositories

One possibility might be
GET /v2/_catalog

Also be certain to look at the following section on pagination of the output, since the size of the registry listing may be unknown, and therefore, quite large.


(Ivanilves) #3

There is a small utility doing what you want to achieve:

(but curl to API is great either)


#4

Hello,
I will describe how i get this list maybe it will help (if i don’t have access to the host on which the registry is deployed i ask someone who does to do that):

$docker exec -it id_of_the_registry_container bash(or /bin/sh)
$find / -name registry

One of the results will have a v2 folder, by default its /var/lib/registry/docker/registry/v2/repositories, and by listing the content of this folder you will see all the images on this registry, but with names not tags, those names i guess are the same as the namespaces.

Regards.