In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/01 Report--
This article introduces the relevant knowledge of "how to build a Docker private warehouse in Linux". In the operation of actual cases, many people will encounter such a dilemma, so let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!
Using Docker private warehouse can help us save network bandwidth. For each image, everyone does not have to go to the central warehouse to download it. You only need to download it from the private warehouse. You can also provide the use of image resources. For images used within the company, push them to the local private warehouse for use by relevant personnel within the company.
Modify configuration http access [root@test01 ~] # cat / etc/docker/daemon.json {"registry-mirrors": ["https://registry.docker-cn.com"],"insecure-registries":["192.168.1.30:5000"]}"
If not configured in this way, the result is as follows. This problem may be due to the fact that the client uses https,docker registry instead of https services. One way to deal with this is to change the customer's request for the address "192.168.1.30 5000" to http.
[root@test01 ~] # docker push 192.168.1.30:5000/centosThe push refers to a repository [192.168.1.30:5000/centos] Get https://192.168.1.30:5000/v1/_ping: http: server gave HTTP response to HTTPS client runs docker-registry [root@test01 ~] # docker run-d-p 5000-- privileged=true-v / opt/data/registry:/tmp/registry-- name='docker-registry' registry using a container
Parameter description:
-v / opt/data/registry:/tmp/registry: by default, the warehouse is stored in the / tmp/registry directory in the container, and the specified local directory is mounted to the container-privileged=true: the security module selinux in CentOS7 disables the permission, and the parameter adds privileges to the container. If the image is not added, a permission error (OSError: [Errno 13] Permission denied:'/ tmp/registry/repositories/liibrary') or (Received unexpected HTTP status: 500 Internal Server Error) will be reported. Upload the image [root@test01 ~] # docker imagesREPOSITORY TAG IMAGE ID CREATED SIZEdocker.io/wordpress latest 346b1443b020 30 hours ago 407. MB [root@test01 ~] # docker push 192.168.1.30:5000/wordpressThe push refers to a repository [192.168.1.30:5000/wordpress] An image does not exist locally with the tag: 192.168.1.30:5000/wordpress [root@test01 ~] #
According to the hint, we know that we need to modify the tag before uploading.
[root@test01 ~] # docker tag docker.io/wordpress 192.168.1.30:5000/wordpress [root@test01 ~] # docker imagesREPOSITORY TAG IMAGE ID CREATED SIZE192.168.1.30:5000/wordpress latest 346b1443b020 30 hours ago 407 MBdocker.io/wordpress latest 346b1443b020 30 hours ago 407 MB [root@test01 ~] # docker push 192.168.1.30:5000/wordpressThe push refers to a repository [192.168.1.30:5000/wordpress] 3d7c1bb6ce9f: Pushed downloads [root@test01 ~] # docker pull 192.168.1.30:5000/wordpress client permanent configuration from a private warehouse to join ADD_REGISTRY='--add-registry 192.168.1.30 docker push 192.168.1.30:5000/wordpressThe push refers to a repository 5000'[root@test01 ~] # cat / etc/sysconfig using a private warehouse / docker# / etc/sysconfig/docker# Modify these options if you want to change the way the docker daemon runsOPTIONS='--selinux-enabled-- log-driver=journald-signature-verification=false-H unix:///var/run/docker.sock-H 0.0.0.0:2376'ADD_REGISTRY='--add-registry 192.168.1.30:5000'if [- z "${DOCKER_CERT_PATH}"] This is the end of then DOCKER_CERT_PATH=/etc/dockerfi 's "how to build a Docker private warehouse in Linux". Thank you for reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!
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.