In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-10 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/02 Report--
Editor to share with you docker how to build a 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!
In Docker, when we execute docker pull xxx, it is actually looking from the address of registry.hub.docker.com, which is the public warehouse provided by Docker. In our work, it is impossible for us to manage the enterprise project push to the public warehouse. So in order to better manage images, Docker not only provides a central repository, but also allows us to build local private repositories.
1. Registry and harbor
Registry is just a pure character set repository. Harbor has its own interface.
The location of harbor is registry,registry, which is just a component of harbor.
Harbor consists of eight containers, one of which is registry
Location where docker images is saved
[root@localhost ~] # cd / var/lib/docker/image/ [root@localhost image] # lsoverlay2 build a private warehouse [root@localhost ~] # docker pull registry download directly
[root@localhost ~] # vim / etc/docker/daemon.json "insecure-registries": ["192.168.133.101 insecure-registries"], add this sentence in the second line
[root@localhost ~] # systemctl restart docker [root@localhost ~] # docker run-d-p 5000 docker run-v / data/registry:/tmp/registry registry824be90701645f27f8b90b50d0cb5f985c189ef9b452c8c8741ae1c6beed4fbc-d daemon-p designated port-v set mount directory last registry startup warehouse
View the image in the repository. It is currently empty.
[root@localhost ~] # curl-XGET http://192.168.133.101:5000/v2/_catalog{"repositories":[]} # v2 is the version _ catalog is to view data
Push the local image to the warehouse
It cannot be pushed directly. It must be marked first.
[root@localhost ~] # docker tag nginx:v4 192.168.133.101:5000/nginx is root by default
Upload image
[root@localhost ~] # docker push 192.168.133.101:5000/nginx
Download from private warehouse
Remove the original mirror image first
Root@localhost ~] # docker rmi 192.168.133.101:5000/nginx
Download images from private repositories
[root@localhost ~] # docker pull 192.168.133.101:5000/nginx
These are all the contents of the article "how to build a Private Warehouse in docker". 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.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.