How to search images from private registry 1.0 in docker?

I made a private registry, curl xx.xx.xx.xx: 5000 is fine. I insert the image into the private docker push xx.xx.xx.xx:5000/centos registry by doing: docker push xx.xx.xx.xx:5000/centos
he is coming back:
http://xx.xx.xx.xx:5000/v1/repositories/centos/tags/latest

the question is how to get all the images from the registry or command. I can not find any information from the registry docker api. Anyone help? :)

+63
docker docker-registry
May 19 '14 at 9:00 a.m.
source share
9 answers

Starting from v 0.7.0 of a private registry you can:

 $ curl -X GET http://localhost:5000/v1/search?q=postgresql 

and you will get json payload:

 {"num_results": 1, "query": "postgresql", "results": [{"description": "", "name": "library/postgresql"}]} 

To get more information on how I started my registry:

 docker run \ -e SETTINGS_FLAVOR=local \ -e STORAGE_PATH=/registry \ -e SEARCH_BACKEND=sqlalchemy \ -e LOGLEVEL=DEBUG \ -p 5000:5000 \ registry 
+66
Jun 17 '14 at 19:51
source share

Now, from the docker client, you can simply directly search your private registry without using the HTTP APIs or any additional tools:

eg. centos image search:

docker search localhost:5000/centos

+75
Nov 04 '14 at 12:40
source share

So, I know that this is a rapidly changing field, but (as of 2015-09-08) I found the following in the Docker Registry HTTP API V2 :

List of repositories ( link )

 GET /v2/_catalog 

Image Tag Announcement ( link )

 GET /v2/<name>/tags/list 

Based on this, I worked in the local registry (registry: 2 ID 1E847b14150e365a95d76a9cc6b71cd67ca89905e3a0400fa44381ecf00890e1, created on 2015-08-25T07: 55: 17.072):

 $ curl -X GET http://localhost:5000/v2/_catalog {"repositories":["ubuntu"]} $ curl -X GET http://localhost:5000/v2/ubuntu/tags/list {"name":"ubuntu","tags":["latest"]} 
+56
Sep 08 '15 at 13:39 on
source share

There is currently no search support for Docker Registry v2 .

The topic was a long stream . The current plan is to support search with an extension at the end that should be ready for v2.1 .

As a workaround, do the following on the computer running your v2 registry:

 > docker exec -it <your_registry_container_id> bash > ls /var/lib/registry/docker/registry/v2/repositories/ 

Images are in subdirectories corresponding to their namespace, for example. jwilder/nginx-proxy

+14
Jun 30 '15 at 12:15
source share

It was possible to get everything in my personal registry by doing a library-only search:

 docker search [my.registry.host]:[port]/library 

Returns (for example):

 NAME DESCRIPTION STARS OFFICIAL AUTOMATED library/custom-image 0 library/another-image 0 library/hello-world 0 
+13
Mar 03 '15 at 21:40
source share

I installed the atc- / docker-registry-web project, which gives me an interface and searches for my personal registry. https://github.com/atc-/docker-registry-web

It is locked and you can just start it

 docker run -p 8080: 8080 -e REG1 = http: //registry_host.name: 5000 / v1 / atcol / docker-registry-ui

and browse the contents by looking at registry_ui_host.name:8080

+5
Sep 17 '14 at 12:45
source share

There is currently no easy way for AFAIK to do this, as this information should be stored at an index that the private registry does not have. But depending on how you started the registry, you have 2 options:

  • if you run the registry without -v to store data in a separate host folder, you can try using docker diff <id_of_registry_container> with this you should get information about changes in fs containers. All clicked images should be somewhere in / tmp / registry / repositories /
  • if you run the registry with -v, just check the contents of the mounted directory on the host

If you used the name "centos" as the name, it should be in / tmp / registry / repositories / library / centos. This folder will contain text files that describe the structure of the image. The actual data is in / tmp / registry / images /.

+3
May 19 '14 at 13:40
source share

List of all images.

 docker search <registry_host>:<registry_port>/ 

List of images such as 'vcs'

 docker search <registry_host>:<registry_port>/vcs 
+3
Mar 22 '16 at 20:15
source share

Another method is one line (if necessary, replace your actual path / ports). Example: assumes a common registry: launch 2.0 In the working registry container there is a log file in which the names of images and tags are stored. I extrapolate the data as follows:

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 change the cut values ​​to get the desired result.

0
Aug 05 '15 at 15:30
source share



All Articles