docker private warehouse (registry V1 and registry V2) operation

Warehouse v1 and v2 versions of the image package:

Link: https: //pan.baidu.com/s/1T4snL6ntNqCtxkF4eiUPcA 
extraction code: jpfe 

 

registry V1 version private warehouse operations

1 to see if the registry V1 warehouse available
curl "http://192.168.23.100:5001"

2, view the registry V1 repository of all the mirrors
curl "http://192.168.23.100:5001/v1/search" 


[@ k8smaster the root zhaiky] # Docker -H 192.168.23.100:2375 SETTINGS_FLAVOR RUN = -d -e -e storage_path = dev / tmp / Registry -v / Data / registry1: / tmp / Registry -p 192.168.23.100:5001: 5000 --restart = always 192.168.23.100:5000/registry:v1 # V1 version running private warehouse
758f01023a9551c16f1c7c7af0ca47d9f3ec9ca70658d55ca4f5afb93c47d239
[root @ k8smaster zhaiky] # curl "http://192.168.23.100:5001" # View V1 version warehouse if normal service
" \ "Docker-Registry Server \" "
[root @ k8smaster zhaiky] #
[root @ k8smaster zhaiky] # curl" http://192.168.23.100:5001/v1/search "# list all image V1 in repository
{ "NUM_RESULTS": 0, "Query": "", "Results": []}
[@ k8smaster the root zhaiky] #

 

registry V2 version private warehouse operations

1, see the registry V2 warehouse is available
[root @ k8smaster zhaiky] # Docker RUN -d -p 5000: 5000 --restart --name = Always Private-Docker-registry12 --privileged to true = = -e REGISTRY_STORAGE_DELETE_ENABLED "to true" - v / data / registry: / var / lib / registry 192.168.23.100:5000/registry:v2 # V2 version running private warehouse
6aae830ba4562706ef5d04696e10b6153b2e015ac80abc0d052ff015ad8211af
[root @ k8smaster zhaiky] # curl "http://192.168.23.100:5000/v2" # Check whether the service warehouse V2 version normal
<a href="/v2/"> Moved Permanently </a>.

2, lists the mirror list of private warehouse registry V2
# curl -X GET HTTP: // <registry_ip>: <REGISTRY_PORT> / v2 / _catalog
[root @ k8smaster ~] # curl -X GET http://192.168.23.100: 5000 / v2 / _catalog # lists all image V2 in repository
{ "repositories": [ "busybox ", "centos", "coredns", "coreos / flannel", "etcd", "kube-apiserver", " kube-controller-manager "," kube-proxy "," kube-scheduler "," kubernetes-ingress-controller / nginx-ingress-controller "," nginx "," pause "," registry "," tomcat "]}
[root @ k8smaster ~] #

3, a mirroring of all listed tags
# curl the -X-the GET HTTP: // <registry_ip>: <REGISTRY_PORT> / V2 / <image_name> / Tags / listt
[k8smaster the root @ ~] # curl the GET the -X-HTP: // 192.168.23.100:5000/v2/tomcat/tags/list # lists all tags designated mirror
{ "name": "Tomcat", "tags": [ "V2"]}
[k8smaster the root @ ~] # 

4、获取镜像信息
[root@k8smaster ~]# curl -v --silent -H "Accept: application/vnd.docker.distribution.manifest.v2+json" -X GET  http://192.168.23.100:5000/v2/tomcat/manifests/v2 #查询具体镜像信息
* About to connect() to 192.168.23.100 port 5000 (#0)
*   Trying 192.168.23.100...
* Connected to 192.168.23.100 (192.168.23.100) port 5000 (#0)
> GET /v2/tomcat/manifests/v2 HTTP/1.1
> User-Agent: curl/7.29.0
> Host: 192.168.23.100:5000
> Accept: application/vnd.docker.distribution.manifest.v2+json

< HTTP/1.1 200 OK
< Content-Length: 2833
< Content-Type: application/vnd.docker.distribution.manifest.v2+json
< Docker-Content-Digest: sha256:635138228afd424e8c45ebef8127a63c3ea4b99da3cc63ba4230f40f8b6d287d
< Docker-Distribution-Api-Version: registry/2.0
< Etag: "sha256:635138228afd424e8c45ebef8127a63c3ea4b99da3cc63ba4230f40f8b6d287d"
< X-Content-Type-Options: nosniff
< Date: Mon, 17 Feb 2020 22:54:48 GMT

5, remove the mirror
[k8smaster the root @ ~] # curl -v -H --silent "the Accept: file application / JSON vnd.docker.distribution.manifest.v2 +" the -X-http://192.168.23.100:5000/v2 the DELETE / tomcat / manifests / sha256: 635138228afd424e8c45ebef8127a63c3ea4b99da3cc63ba4230f40f8b6d287d # delete private warehouse inside mirror
* Connect to the About () to 192.168.23.100 Port 5000 (# 0)
* Trying 192.168.23.100 ...
* Connected to 192.168.23.100 (192.168.23.100) 5000 Port (# 0)
> the DELETE / V2 / Tomcat / manifests / SHA256: 635138228afd424e8c45ebef8127a63c3ea4b99da3cc63ba4230f40f8b6d287d the HTTP / 1.1
> the User-- Agent: curl / 7.29.0
> the Host: 192.168.23.100:5000
> the Accept: file application / vnd.docker.distribution. + JSON manifest.v2

<the HTTP / 1.1 202 Accepted
< Docker-Distribution-Api-Version: registry/2.0
< X-Content-Type-Options: nosniff
< Date: Mon, 17 Feb 2020 22:56:46 GMT
< Content-Length: 0

* Connection #0 to host 192.168.23.100 left intact
[root@k8smaster ~]# 

Published 60 original articles · won praise 20 · views 4608

Guess you like

Origin blog.csdn.net/zhaikaiyun/article/details/104400746