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

Detailed explanation of the steps of Harbor installation in Docker private server warehouse

2025-03-29 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

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

Harbor installation is still very simple, that is, I fell into the pit at Docker Login, worked for a long time, and reinstalled it when I was writing a blog.

1. Prepare two servers

Centos7harbor 10.19.46.15client 10.19.44.31

2.harbor needs to install docker and docker-composere,client only need to install docker

Docker installation

Yum install-y yum-utils device-mapper-persistent-data lvm2yum-config-manager-- add-repo https://download.docker.com/linux/centos/docker-ce.repoyum-y install docker-cesystemctl start docker

Docker Compose installation

Docker Compose installs yum install epel-releaseyum install-y python-pippip install docker-composeyum install git

Harbor1.8 download

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

Decompress it out.

[root@harbor harbor] # the total amount of ll is 32 r / w / r / m / r / R / M / R / R 1 root root 4519 May 21 15:59 harbor.yml-rwxr-xr-x. 1 root root 5088 May 21 15:59 install.sh-rw-r--r--. 1 root root 11347 May 21 15:59 LICENSE-rwxr-xr-x. 1 root root 1654 May 21 15:59 prepare

Modify harbor.yml

Hostname sets the local ip here

Password for the harbor_admin_password web page

Running

Sh. / install.sh

Installation succeeded

.Status: Downloaded newer image for goharbor/harbor-registryctl:v1.8.0Creating harbor-log... DoneCreating harbor-db... DoneCreating registry... DoneCreating redis... DoneCreating registryctl... DoneCreating harbor-core... DoneCreating harbor-jobservice... DoneCreating harbor-portal... DoneCreating nginx... Done ✔-Harbor has been installed and started successfully.----Now you should be able to visit the admin portal at http://10.19.46.15. For more details, please visit https://github.com/goharbor/harbor.

Visit the page

Http://10.19.46.15

If you want to stop, or if the server is restarted, you need to restart manually and execute the command in the harbor installation directory.

[root@harbor harbor] # ll total dosage 40drwxr-xr-x. 3 root root 20 May 22 22:24 common-rw-r-. 1 root root 5183 May 22 22:24 docker-compose.yml-rw-r--r--. 1 root root 4514 May 22 22:23 harbor.yml-rwxr-xr-x. 1 root root 5088 May 21 15:59 install.sh-rw-r--r--. 1 root root 11347 May 21 15:59 LICENSE-rwxr-xr-x. 1 root root 1654 May 21 15:59 prepare# stops [root@harbor harbor] # docker-compose stopStopping nginx. DoneStopping harbor-portal... DoneStopping harbor-jobservice... DoneStopping harbor-core... DoneStopping registryctl... DoneStopping redis... DoneStopping registry... DoneStopping harbor-db... DoneStopping harbor-log... Done# runs [root@harbor harbor] # docker-compose startStarting log... DoneStarting postgresql... DoneStarting redis... DoneStarting registry... DoneStarting core... DoneStarting jobservice... DoneStarting portal... DoneStarting proxy... DoneStarting registryctl... Done

Log in to harbor on another server (client)

[root@client ~] # docker login 10.19.46.15Username: adminPassword: Error response from daemon: Get https://10.19.46.15/v2/: dial tcp 10.19.46.15 docker login 10.19.46.15Username 443: connect: connection refused

This is because the docker1.3.2 version defaults to docker registry using https, and we set the default http mode for Harbor, so an error will be reported when executing commands such as docker login, pull, push and other commands to operate non-https docker regsitry.

Resolve https

On the server in harbor, in the installation directory of harbor

Vim docker-compose.yml

Then edit the docker configuration file for both harbor and client, 10.19.46.15 is the ip address of harbor

# 1.vim / etc/docker/daemon.json {"insecure-registries": ["10.19.46.15"]} # 2. Add ExecStart=/usr/bin/dockerd |-- insecure-registry=10.19.46.15vim / usr/lib/systemd/system/docker.service# to comment out this line and add the following configuration ExecStart=/usr/bin/dockerd-H fd://-- containerd=/run/containerd/containerd.sockExecStart=/usr/bin/dockerd |-- insecure-registry=10.19.46.15

1. Restart the docker-compose of harbor. The command text contains

two。 Restart docker

Systemctl daemon-reloadsystemctl restart docker

Client logs in to the warehouse

[root@client ~] # docker login 10.19.46.15 Username: adminPassword: WARNING! Your password will be stored unencrypted in / root/.docker/config.json.Configure a credential helper to remove this warning. See https://docs.docker.com/engine/reference/commandline/login/#credentials-storeLogin Succeeded

use inferior materials and turn out substandard goods

Pull's command

Command to push and hit tag

The above is the whole content of this article, I hope it will be helpful to your study, and I also hope that you will support it.

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