Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to realize Registry Construction of Docker Private Warehouse

2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)05/31 Report--

How to realize the Registry construction of Docker private warehouse, in view of this problem, this article introduces the corresponding analysis and solution in detail, hoping to help more partners who want to solve this problem to find a more simple and feasible method.

# = = > Domain name or hostname signdomain=a.b.cn#== > generate SSL certificate mkdir ~ / certsopenssl req-nodes-subj "/ C=CN/ST=ZheJiang/L=HangZhou/CN=$signdomain"-newkey rsa:4096-keyout ~ / certs/$signdomain.key-out ~ / certs/$signdomain.csropenssl x509-req-days 3650-in ~ / certs/$signdomain.csr-signkey ~ / certs/$signdomain.key-out ~ / certs/$signdomain.crt#== > run docker registry v2docker run-d-p 5000-restart=always-name registry\ -v ~ / certs:/certs\-e REGISTRY_HTTP_TLS_CERTIFICATE=/certs/$signdomain.crt\-e REGISTRY_HTTP_TLS_KEY=/certs/$signdomain.key\ registry:2#== > try push image docker tag ubuntu a.b.cn:5000/ubuntudocker push a.b.cn:5000/ubuntu

# = = > the following error occurred:

The push refers to a repository [a.b.cn:5000/ubuntu] (len: 1)

Unable to ping registry endpoint https://a.b.cn:5000/v0/

V2 ping attempt failed with error: Get https://a.b.cn:5000/v2/: x509: certificate signed by unknown authority

V1 ping attempt failed with error: Get https://a.b.cn:5000/v1/_ping: x509: certificate signed by unknown authority

# = = > the error is caused by the absence of an authoritative self-signed certificate. The following directory is found on the node where crt is copied to docker Damon (in the case of the current node, other nodes are similar to scp in the past): mkdir / etc/docker/certs.d/$signdomain:5000cp ~ / certs/$signdomain.crt / etc/docker/certs.d/$signdomain:5000/ca.crt#== > verify pull and pushdocker pull a.b.cn:5000/ubuntu

Overall:

# Import registry v2 image package sudo docker load < registry.2.tar# set registry host domain name or host name signdomain=docker-1# set registry authentication file directory sudo mkdir ~ / certs#openssl generate authentication file sudo openssl req-nodes-subj "/ C=CN/ST=ZheJiang/L=HangZhou/CN=$signdomain"-newkey rsa:4096-keyout ~ / certs/$signdomain.key-out ~ / certs/$signdomain.csrsudo openssl x509-req-days 3650-in ~ / certs/$signdomain.csr-signkey ~ / certs/ $signdomain.key-out ~ / certs/$signdomain.crt# run the registry container sudo docker run-d-p 5000 REGISTRY_HTTP_TLS_CERTIFICATE=/certs/$signdomain.crt 5000-- name registry-v ~ / certs:/certs-e REGISTRY_HTTP_TLS_CERTIFICATE=/certs/$signdomain.crt-e REGISTRY_HTTP_TLS_KEY=/certs/$signdomain.key registry:2# to copy the crt file to the / etc/docker/cert.d/$signdomain:5000 directory of each docker Damon host (there is no new first) sudo mkdir / etc/docker/certs. D/sudo mkdir / etc/docker/certs.d/$signdomain:5000sudo cp ~ / certs/$signdomain.crt / etc/docker/certs.d/$signdomain:5000/ca.crt# Test registry Service sudo docker tag registry:2 docker-1:5000/registry:2sudo docker push docker-1:5000/registry:2 's answer to the question on how to implement the Registry construction of Docker private warehouse is shared here I hope the above content can help you to a certain extent, if you still have a lot of doubts to be solved, you can follow the industry information channel to learn more related knowledge.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report