Docker node query and method of obtaining the mirror in the private warehouse registry

A certain docker node pushes to the mirror in the private warehouse. If you want to see which mirrors are available on other docker nodes, and then pull, you can use the following methods:
docker node gets the mirror of the warehouse class:

[root@node1 docker]# curl -XGET http://192.168.1.100:5000/v2/_catalog
{
    
    "repositories":["busybox"]}

After obtaining the image name, you need to obtain the label list of the image, and then pull based on the image name and label

[root@node1 docker]# curl -XGEThttp://192.168.1.100:5000/v2/image_name/tags/list
{
    
    "errors":[{
    
    "code":"NAME_UNKNOWN","message":"repositoryname not known toregistry","detail":{
    
    "name":"image_name"}}]}
[root@node1 docker]# curl -XGEThttp://192.168.1.100:5000/v2/busybox/tags/list
{
    
    "name":"busybox","tags":["latest"]}

Now that the currently queried mirror name and tag list are available, you can pull the mirror in the private mirror warehouse

[root@node1 docker]# docker pull 192.168.1.100:5000/busybox:latest
Trying to pull repository 192.168.1.100:5000/busybox ... 
latest: Pulling from 192.168.1.100:5000/busybox
e2334dd9fee4: Pull complete 
Digest: sha256:a2490cec4484ee6c1068ba3a05f89934010c85242f736280b35343483b2264b6
Status: Downloaded newer image for 192.168.1.100:5000/busybox:latest

Note: The prerequisite for querying the mirror image of the private warehouse is that the mirror image has been uploaded (push) before.

Guess you like

Origin blog.csdn.net/qq_42428671/article/details/105965321