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

Configuration of Docker Private Warehouse Harbor

2025-02-25 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

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

This article is about the configuration of Harbor, a private repository for Docker. The editor thought it was very practical, so I shared it with you as a reference. Let's follow the editor and have a look.

Harbor introduces that Harbor is vmware's open source enterprise docker registry project Harbor's advantages based on role control image-based replication strategy support LDAP/AD image deletion and garbage collection graphics UI audit RESTful APIHarbor architecture composition Proxy: through a front-end reverse agent to uniformly accept requests from browsers and docker clients, and forward requests to different back-end services Registry: responsible for storing Docker images And deal with the core functions of docker push/pull commands Core services:Harbor, including UI,webhook,token services Database: providing database services for core services Log collector: responsible for collecting log of other components for later analysis of Docker private repository architecture topology

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.

Users request to access Core services,UI through Proxy reverse proxy to provide web interface and token token. The server will give you a series of serial numbers after you log in for the first time, and the next time you log in directly, the image information and attributes you need to download will be stored in the following database, and then go to the registry private warehouse to retrieve the image through webhook callback. This series of operations are stored in the log.

Lab environment docker private library server 192.168.13.128 (docker, Harbor, docker-compose) docker client 192.168.13.129 (docker) 1 Configure harbor Private Library Server [root@harbor ~] # mount.cifs / / 192.168.100.3/LNMP-C7 / mnt/Password for root@//192.168.100.3/LNMP-C7: [root@harbor ~] # cd / mnt/ [root@harbor mnt] # cd docker/ [root@harbor docker] # cp docker-compose / usr/local/bin/ # # install compose orchestration tool [root@harbor docker] # tar zxvf harbor-offline-installer-v1.2 .2.tgz-C / usr/local/ # # decompress [root@harbor docker] # cd / usr/local/harbor/ [root@harbor harbor] # vim harbor.cfg # # modify the harbor configuration file hostname = 192.168.13.128 # # modify the host to the local address harbor_admin_password = Harbor12345 # # harbor password [root@harbor harbor] # sh / usr/local/harbor/install.sh # # launch Harbor [root @ harbor harbor] # docker images # # Image information [root@harbor harbor] # docker ps-a # # View container information 49b88d8877ae vmware/registry:2.6.2-photon "/ entrypoint.sh serv …" 5000/tcp registry [root@harbor harbor] # docker-compose ps # # Container simple Information 2, log in to the harbor private library web interface

three, Log in to the private library on the harbor server [root@harbor harbor] # docker login-uadmin-p Harbor12345 http://127.0.0.1 # # log in to the private library [root@harbor harbor] # docker pull cirros # # download the image [root@harbor harbor] # docker tag cirros 127.0.0.1/myproject-kgc/cirros:v1 # # modify the tag [root@harbor harbor] # docker push 127.0.0.1/myproject-kgc/cirros:v1 # # Upload to private database # # access private database information on web

four, Use the client client to log in to the private library [root@client ~] # vim / usr/lib/systemd/system/docker.service # # modify the docker configuration file ExecStart=/usr/bin/dockerd-H fd://-- nsecure-registry 192.168.13.128-- containerd = / run/containerd/containerd.sock## add the private library server address [root@client ~] # systemctl daemon-reload # # reload daemon [root@client ~] # systemctl restart docker # # restart container [root@client ~] # docker login-uadmin-pHarbor12345 http://192.168.13.128 # # Log in to the private database [root@client ~] # docker pull cirros # # download [root@client ~] # docker pull 192.168.13.128/myproject-kgc/cirros:v1 # # download the image [root@client ~] # docker tag cirros:latest 192.168.13.128/myproject-kgc/cirros:v2 from the private database # # modify the tag [root@client ~] # docker push 192.168.13.128/myproject-kgc/cirros:v2 # # upload it to the private database server # # check it through the web interface

5. Manage private libraries, configure [root@harbor harbor] # docker-compose down-v # # on the harbor server to close all containers with compose management [root@harbor harbor] # vim harbor.cfg # # modify the configuration file [root@harbor harbor] #. / prepare # # reload effective [root@harbor harbor] # docker-compose up-d # Open all containers as needed

# # sign in with client [root@client ~] # docker logout http://192.168.13.128 # # first log out of the administrator login Removing login credentials for 192.168.13.128 [root@client ~] # docker login http://192.168.13.128 # # log in to Username: test01Password: 6 with the newly created user, if you want to redeploy You need to remove all data from the server while retaining the mirror data / database [root@harbor harbor] # docker-compose down-v # # first close all container logs and store the data on the host / var/log/harbor. Image deletion: rm-rf / data/database/rm-rf / data/registry/ so much for the configuration of Docker private repository Harbor. I hope the above can help you and learn more. If you like this article, you might as well share it for more people to see.

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