I made a private registry,curl xx.xx.xx.xx:5000 is ok.
I push an image into docker private registry by doing:
docker push xx.xx.xx.xx:5000/centos
it return:
http://xx.xx.xx.xx:5000/v1/repositories/centos/tags/latest
the question is how to get all images from registry web or command whatever. I cant find any information from docker registry api. any one helps ? :)
Currently there's no search support for Docker Registry v2.
There was a long-running thread on the topic. The current plan is to support search with an extension in the end, which should be ready by v2.1.
As a workaround, execute the following on the machine where your registry v2 is running:
The images are in subdirectories corresponding to their namespace, e.g.
jwilder/nginx-proxy
Currently AFAIK there is no easy way to do this as this information should be stored by index which private registry doesn't have. But depending on how you started registry you have 2 options:
docker diff <id_of_registry_container>
with this you should get info about changes in container fs. All pushed images should be somewhere in /tmp/registry/repositories/If you used "centos" as name it should be in /tmp/registry/repositories/library/centos. This folder will contain text files which describes image structure. Actual data is in /tmp/registry/images/.
Now from docker client you can simply search your private registry directly without using the HTTP APIs or any extra tools:
e.g. searching for centos image:
docker search localhost:5000/centos
Another method one line (substitute your actual path/ports if needed). Example: assumes a generic registry:2.0 start up The running registry container has a log file that holds image and tag names. I extrapolate the data like this:
grep -r -o "vars.name=.* vars.reference=." /var/lib/docker/containers/ | cut -c 167-225 | sed 's/ver.*$//' | sed 's/vars.name=//' | sed 's/ vars.reference=/:/' | sort -u
you may need to tweak the cut values to get the output desired.
So I know this is a rapidly changing field but (as of 2015-09-08) I found the following in the Docker Registry HTTP API V2:
Listing Repositories (link)
Listing Image Tags (link)
Based on that the following worked for me on a local registry (registry:2 IMAGE ID 1e847b14150e365a95d76a9cc6b71cd67ca89905e3a0400fa44381ecf00890e1 created on 2015-08-25T07:55:17.072):
Modifying answer from @mre to get the listing just from one command (valid at least for Docker Registry v2)
docker exec -it ls -a /var/lib/registry/docker/registry/v2/repositories/