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 use docker Private Warehouse

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

Share

Shulou(Shulou.com)06/01 Report--

Editor to share with you how to use the docker private warehouse, I believe that most people do not know much about it, so share this article for your reference, I hope you can learn a lot after reading this article, let's go to know it!

1. Download the repository image

Docker pull registry

two。 Create a private warehouse container-d means the background starts

Docker run-d-p 5000UR 5000-v / opt/data/registry:/var/lib/registry registry

3. Firewall removes port 5000 restriction

Firewall-cmd-zone=public-add-port=5000/tcp-permanent

4. Verify whether the private warehouse has been started successfully

Http://192.3.8.12:5000/v2

5. Package image

Docker tag my-nginx:v1 192.168.56.200:5000/centos

6. Upload the packaged image to the private warehouse

[root@server1 ~] # docker push 192.168.56.200:5000/centosThe push refers to a repository [192.168.56.200:5000/centos] Get https://192.168.56.200:5000/v1/_ping: http: server gave HTTP response to HTTPS client

This problem may be due to the fact that the client uses https,docker registry instead of https services. One way to handle this is to change the customer's request for the address "192.168.56.200 http 5000".

Solution:

In the / etc/docker/ directory, create a "daemon.json" file. Write in the file: {"insecure-registries": ["192.168.56.200 insecure-registries 5000"]}

After saving and exiting, restart docker.

7. There is a problem again when uploading again, because selinux is not turned off. Use the setenforce 0 command to set temporary shutdown, or vi / etc/sysconfig/selinux to change the line inside to SELINUX=disabled and save it, and then restart it. )

8. View the images in the private repository

Http://192.3.8.187:5000/v2/_catalog

9. This downloads the image of the private repository on server2.

Docker pull 192.168.56.200:5000/centos

10. Backup and restore of warehouse images.

Directly back up / opt/data/registry on a regular basis, and restore can be started directly by hanging to the docker-registry image.

Docker run-d-p 5000 5000-v / opt/data/registry:/var/lib/registry registry above is all the content of this article "how to use docker Private Warehouse". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!

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