In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-02 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/03 Report--
1. Harbor
Harbor is an open source enterprise Docker Registry project from VMware:
(1) advantages of Harbor:
Role-based control
Mirror-based replication strategy
Support for LDAP / AD
Image deletion and garbage collection
Graphic UI
Audit
RESTful API
(2) composition of Harbor architecture:
1. Proxy: accept requests from browsers and Docker clients through a front-end reverse proxy, and forward the requests to different back-end services.
2. Registry: responsible for storing Docker images and processing docker push/pull commands.
3. The core functions of Core services:Harbor, including UI, webhook and token services.
4. Database: provide database services for core services.
5. Log collector: responsible for collecting the log of other components for later analysis.
Second, the advantages of private warehouses:
In fact, the original source of images of private libraries is downloaded from public libraries, but why not all enterprises use public libraries directly to download the images they need? they are allowed to use registry to build local private repositories, which have advantages that these public libraries do not have:
1. Save network bandwidth. For each image, everyone doesn't have to go to the central warehouse to download it, just download it from the private warehouse.
2. Provide the use of image resources. Images used within the company are pushed to the local private warehouse for use by relevant personnel within the company.
Next, let's build a private docker repository:
(1) install the relevant software packages:
Install harbor: [root@localhost abc] # tar zvxf harbor-offline-installer-v1.2.2.tgz-C / usr/local/ install docker-compose: [root@localhost abc] # cp docker-compose / usr/bin/// copy docker-compose to the / bin/ directory, after the system recognizes it, you can directly use the docker-compose command.
(2) modify the harbor.cfg configuration file:
(3) start
[root@localhost local] # cd harbor/ [root@localhost harbor] # lscommon docker-compose.yml harbor.v1.2.2.tar.gz NOTICEdocker-compose.clair.yml harbor_1_1_0_template install.sh preparedocker-compose.notary.yml harbor.cfg LICENSE upgrade [root@localhost harbor] # sh / usr/local/harbor/install.sh / / Open
(4) check whether the image and container have been started:
Docker images / / View Image docker ps-a / / View Container docker-compose ps / / View Container
(5) Verification: visit 192.168.220.131 with a browser
User name, password and other information can be queried in the harbor.cfg file. If you do not modify them, the default is:
User name: admin
Secret code: Harbor12345
(6) manually create an image (click "+ Project"): create a project named myproject-kgc:
(7) after the image has been created, return to the console, and log in and push the image locally through 127.0.0.1 via the docker command:
Docker login-u admin-p Harbor12345 http://127.0.0.1
(8) download an image from the public database and upload it to the private database:
[root@localhost harbor] # docker pull cirros / / download image [root@localhost harbor] # docker tag cirros 127.0.0.1/myproject-kgc/cirros:v1 / / Image replacement label
(9) upload the newly tagged image to the private database
[root@localhost harbor] # docker push 127.0.0.1/myproject-kgc/cirros
(10) after uploading, we can see this image in Harbor:
(11) Open another virtual machine as a client and connect to Harbor to upload and download images:
1. First, modify the / usr/lib/systemd/system/docker.service configuration file, associate the private library, and add the following code (be sure to add it, otherwise an error will occur):
-- insecure-registry 192.168.220.131
2. Load
Systemctl daemon-reload / / reload systemctl restart docker / / restart
3. Log in
Docker login-u admin-p Harbor12345 http://192.168.220.131
4. Now we can download the images already in the private library on this client:
Docker pull 192.168.220.131/myproject-kgc/cirros:v1
5. Download an image from the public database, tag it, and upload it to the private database:
[root@localhost ~] # docker pull cirros [root@localhost ~] # docker tag cirros:latest 192.168.220.131/myproject-kgc/cirros:v2 [root@localhost ~] # docker push 192.168.220.131/myproject-kgc/cirros:v2
6. At this time, a new uploaded image can be found in Harbor:
7. We can also download our commonly used images, tag them and upload them to the private database:
[root@localhost ~] # docker pull nginx [root@localhost ~] # docker tag nginx:latest 192.168.220.131/myproject-kgc/nginx:v1 [root@localhost ~] # docker push 192.168.220.131/myproject-kgc/nginx:v1
8. At this point, a new image will be added to Harbor:
3. Manage private libraries: [root@localhost harbor] # docker-compose down-v / / close all containers
[root@localhost harbor] # docker-compose up-d
Add users: user Management-> create users (note that passwords need uppercase + lowercase)
[root@localhost ~] # docker logout http://192.168.220.131[root@localhost ~] # docker login http://192.168.220.131
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.