Harbor mirror the Linux environment to build warehouse

Harbor mirroring warehouse structures
1, to prepare the environment (Linux systems, networked server)
you need to install Docker, Docker-Compose
1.1Docker install
# yum update package
[root @ centos7 ~] # yum update

# 卸载旧版本 Docker
[root@centos7 ~]# yum remove docker docker-common docker-selinux docker-engine

# Installation package
[root @ centos7 ~] # yum install -y yum-utils device-mapper-persistent-data lvm2

# 添加 Docker yum源
[root@centos7 ~]# yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo

# 安装 Docker
[root@centos7 ~]# yum -y install docker-ce

# 启动 Docker
[root@centos7 ~]# systemctl start docker

See Docker version number #
[@ centos7 the root ~] # Docker --version
----------------
1.2 Docker Compose installation
#-Release mounting EPEL
[centos7 the root @ ~] # yum the install epel-release

#-Mounted PIP Python
[centos7 the root @ ~] # yum the install Python -Y-PIP

# 安装 docker-compose
[root@centos7 ~]# pip install docker-compose

# Mounting Git
[centos7 the root @ ~] # yum the install Git

# View docker-compose the version number
[root @ centos7 ~] docker-compose -version
----------------
2. Installation Harbor
2.1 Harbor to download and install the
Harbor # Online download the installation package
wget https://storage.googleapis.com/harbor-releases/release-1.9.1/harbor-online-installer-v1.9.1.tgz
# extracting installation package
the tar-XF Harbor Online-Installer-v1.8.1.tgz
# enter harbor catalog
cd harbor
# modify the host name and administrator password, database password
vim harbor.yml
# modify the content
----------------------------- -------------------------------------------------- ----
hostname: 10.0.0.11 # modify the external IP server IP
harbor_admin_password: 123456 # modify Harbor admin password
database:
password: 123456 # modify the database password
-------------------------------------------------- ------------------------------------
# install
./install.sh
# Then there is a long wait
2.2 Harbor visit
after the installation is complete, open the browser http: 10.0.0.11, you can see the Harbor interface.

 

Here I would like to say a question
Harbor is to build complete, there may be some problems when we upload project

docker login 10.0.0.11
Username: admin
Password:
Error response from daemon: Get https://10.0.86.193/v1/users/: dial tcp 10.0.86.193:443: getsockopt: connection refused

When we log in to upload code will be reported out such a mistake
because docker1.3.2 default since version docker registry using https, we set the default http Harbor way, so when execution docker login, pull, push commands the error will be non-https operation of the docker regsitry.
Solution:
1, if it is in Harbor Log on to do so as resolved

If the system is MacOS, you can click on the "Preference" inside "Advanced" in "Insecure
Registry" in plus 10.0.86.193, restart Docker client on it.
If the system is the Ubuntu, modifying the configuration file /lib/systemd/system/docker.service, modified [-Service] under ExecStart parameters, Registry-increasing -insecure
10.0.86.193.
If the system is Centos7, the following may be added (note json string) in /etc/docker/daemon.json
{
"in the insecure-Registries": [
"10.0.86.193"
]
}

Open docker-compose.yml add the following note in front of a space

Then we execute Compose STOP-Docker
./install.sh
login again on OK

[root@docker02appl]# docker login 10.0.0.11
Username(admin): admin
Password:
Login Succeeded

2, if you log in remotely, then this error will occur

Find Docker's service file: Log on to the server has been installed Docker, enter systemctl status docker View Docker's service file.

Edit docker.service file: Add -insecure-registry parameters ExecStart at the back with Harbor is your IP address.


Reload service files, restart the docker services, restart the docker-compose services.
daemon-reload systemctl
systemctl the restart Docker
Docker the restart-Compose

Login again:
Docker the Login [ip address or domain name] (Harbor address, hostname entry harbor.cfg file)
// enter a user name and password as prompted

** Attach pull and push commands: **
3 \ .Harbor use PW

# Before you can push to be logged Harbor
Docker the Login 10.0.86.193
ADMIN
Harbor12345
prompt success successful login

to see what they have mirror; docker images
to be uploaded to the mirror Harbor run the following command on it
# mirrored playing tag
[root @ centos7 ~] #docker mirror tag name: PW tag address / warehouse item name / image name: tag

# pushed PW
[root @ centos7 ~] #docker push address PW / warehouse item name / image name: tag

# image from pulling PW
[root @ centos7 ~] #docker pull Sifu address / warehouse project name / image name: label

Guess you like

Origin www.cnblogs.com/skyfighter123/p/11755404.html