background

Harbor is docker’s private server; Manage the internal output of mirror products;

Is VMware Company China team for enterprise users to design image registration server, purpose: storage and distribution of Docker image;

In the official Docker Registry service added security, access control, audit, management page, discovery, high availability and other functions;

The installation

Find a Linux machine: Docker-compose installed ahead of time;

  1. Download the Harbor installation package

If not, go to CSDN to find a domestic resource to download;

Wget HTTP: / / https://github.com/goharbor/harbor/releases/download/v2.1.2/harbor-offline-installer-v2.1.2.tgzCopy the code
  1. Unpack the
Tar - XZVF harbor - offline installer - v2.1.2. TGZCopy the code
  1. Modifying a Configuration File
vim harbor.cfg
Copy the code

Modification:

Harbor_admin_password; The default password

Hostname: access IP address

  1. Start the harbor
./install.sh
Copy the code
  1. Check the container
docker ps
Copy the code
  1. Start and stop harbor using docker-compose
docker-compose stop
docker-compose start
Copy the code

Harbor default trust HTTPS protocol, so if docker command login and push image, need to add –insecure-registry to docker configuration file;

Modifying the configuration method:

Background UI usage

Open: http://hostname/harbor

Account: admin

Password: Your default administrator password

Harbor environment built:

Client use

  1. Docker login registry
docker login  -u admin -password-stdin xxxx   xxx.com
Copy the code
  1. Local Docker image tag:
docker tag repox:tagName xxx.com/project/repox:tagName
Copy the code
  1. Local image push:
docker push  xxx.com/myproject/myrepo:mytag
Copy the code
  1. Remotely obtain the image and run it.

Log in and obtain the image directly from the image center.

See Step 1:

docker pull xxx.com/project/repox:tagName
Copy the code

In actual combat

Docker and Docker-compose to run locally developed programs;

  1. Locally as ci environment, make a mirror and push it to harbor;

  2. Remote server as CD environment, through harbor pull image to run the program;

  3. Extended as a k8S mirror warehouse to support K8S deployment;

data

Source: github.com/goharbor/ha…

Liverpoolfc.tv: goharbor. IO /

Installation and use of harbor: www.toutiao.com/a6840826675…