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

Create a private repository for Harbor

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

Share

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

Download the package that will be used later: docker-compose

Curl-L https://github.com/docker/compose/releases/download/1.25.1-rc1/docker-compose-`uname-s-uname-M`-o / usr/local/bin/docker-compose

Give me permission.

Chmod + x / usr/local/bin/docker-compose

Download dependency:

Yum- y install yum-utils device-mapper-persistent-data lvm2

Download the URL of the other two Harbor packages:

Https://github.com/goharbor/harbor/releases

Download and import into the virtual machine.

Then decompress:

Tar zxf harbor-offline-installer-v1.7.4.tgz-C / usr/local/

Cd to the compressed directory and modify the configuration file:

[root@docker1 ~] # cd / usr/local/harbor/

[root@docker1 harbor] # vim harbor.cfg

Hostname=192.168.2.10 # # changed to native ip

Perform the installation:

. / install.sh

Modify the docker configuration file:

Vim / usr/lib/systemd/system/docker.service

Line 13:

ExecStart=/usr/bin/dockerd-- insecure-registry 192.168.1.10 # # is also a native ip

Restart the docker service: [root@docker1 harbor] # systemctl daemon-reload

[root@docker1 harbor] # systemctl restart docker.service

Execute the following command:

[root@docker1 harbor] # docker-compose start

Use a browser to access Harbor:

Click New Project:

I call it bdqn here:

Log in to Harbor using the command line:

Docker login-u admin-p Harbor12345 192.168.1.10

Upload an image:

First, change the name of the image to be uploaded:

Docker tag centos:7 192.168.1.10/bdqn/centos:7

Upload:

Docker push 192.168.2.10/bdqn/centos:7

Note that if no image needs to be downloaded in advance, the command is as follows: after the image name that docker pull needs to download is uploaded successfully, verify: open the second docker virtual machine:

On the first, send the docker file that has been configured above to the second docker virtual machine:

Scp / usr/lib/systemd/system/docker.service192.168.1.20:/usr/lib/systemd/system/

Operate on the second virtual machine:

Restart the docker service:

Systemctl daemon-reload

Systemctl restart docker.service

Log in to Harbor:

Docker login-u admin-p Harbor12345 192.168.1.10

Download the image uploaded from the first docker virtual machine:

Docker pull 192.168.1.10/bdqn/centos:7

Finally, check the downloaded image:

Docker images

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