Get the App
SLTechnology News&Howtos  ›  Servers  › 

How to install and configure harbor to build docker Private Warehouse

Shulou Source: shulou.com Published: 2022-06-03 04:36:37 09月22日 Update

How to install and configure harbor to build a private docker repository? To solve this problem, today the editor summarizes this article on installing and configuring harbor, hoping to help more friends who want to solve this problem to find a more simple and easy way.

1 harborharbor is vmware's open source enterprise registry, which allows you to quickly build your own private registry. Is based on docker's native registry.

2 installing the harbor2.1 dependency package installs all the components of Harbor that run in the docker container, so you need to install docker. All officially recommended installations are based on docker compose, so you need to deploy docker compose. Since Harbor is based on Docker Registry V2 version, it is required that the Docker version is not less than 1.10.0 and the Dockercompose version is not less than 1.6.0.

My environment is centos 7.7 and the source is https://mirrors.aliyun.com/docker-ce/linux/centos/7/x86_64/stable/, as shown below

# install docker Community Edition

> > yum install docker-ce

# install Docker-compose, download version 1.13.0 here

> > curl-L https://github.com/docker/compose/releases/download/1.13.0/docker-compose-`uname-s`-`uname-m` > / usr/local/bin/docker-compose

# add execution permission for docker-compose

> > chmod + x / usr/local/bin/docker-compose

# check whether docker-compose is installed successfully and whether the version is installed

> > docker-compose-- version

2.2 install harbor# download harbor installation files from github

> > wget https://github.com/vmware/harbor/releases/download/v1.1.2/harbor-online-installer-v1.1.2.tgz

# decompression

> > tar xvf harbor-online-installer-v1.1.2.tgz

# enter the extracted directory, edit harbor.cfg, and change the hostname field to the local hostname or IP address, where the field harbor_admin_password is the password of the admin user when you log in to the harbor web page after installation

# execute install, which will be deployed using docker-compose based on the contents of docker-compose.yml in the current directory

> >. / install.sh

After the execution is complete, you can see that the containers have been run successfully.

3 after the client access test is installed, the web page discovery service has been set up.

Using the default password Harbor12345 (specified in harbor.cfg in 2.2), this page can view a list of all the images in the library

In addition, you can log in to docker registry in harbor through docker login on other docker hosts. The default is https.

There are two ways to solve the above.

1. The certificate and private key are specified in the configuration file harbor.cfg during installation. For the generation of self-signed certificates, please refer to 3.4.3 in https://blog.51cto.com/tobyxia/2465694.

two。 Modify the configuration / usr/lib/systemd/system/docker.service to add ExecStart-insecure-registry 192.168.80.42, where the IP address is filled in the ip of Harbor, execute systemctl daemon-reload and restart docker

In addition, you can change the default warehouse of a docker host to a self-built harbor in the following ways

The above is the method of installing and configuring harbor, and you have to use it yourself in order to know the details. If you want to read more related articles, you are welcome to follow the industry information channel!

Tags: Configuration version host content method warehouse private success middle finger can pass address field container password file article more directory web page Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Docker Linux MySQL Apple vpn