Harbor - 企业级 Docker 私有仓库

一、Docker Compose 安装

[root@localhost ~]#  yum -y install epel-release
[root@localhost ~]# yum -y install python-pip
[root@localhost ~]# pip --version
pip 8.1.2 from /usr/lib/python2.7/site-packages (python 2.7)
[root@localhost ~]# pip install --upgrade pip
[root@localhost ~]# pip install docker-compose
编译中断。 error: command 'gcc' failed with exit status 1 ---------------------------------------- ERROR: Command errored out with exit status 1: /usr/bin/python2 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-SF_hPB/subprocess32/setup.py'"'"'; __file__='"'"'/tmp/pip-install-SF_hPB/subprocess32/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-MXLYK7/install-record.txt --single-version-externally-managed --compile Check the logs for full command output.

解决办法

yum install python-devel
yum install libevent-devel
pip install gevent
[root@localhost ~]# docker-compose version
docker-compose version 1.25.0, build b42d419
docker-py version: 4.1.0
CPython version: 2.7.5
OpenSSL version: OpenSSL 1.0.2k-fips  26 Jan 2017
[root@localhost ~]# docker --version
Docker version 19.03.5, build 633a0ea
[root@localhost ~]# tar -zxf harbor-offline-installer-v1.2.0.tgz
[root@localhost ~]# cd harbor
[root@localhost harbor]# vi /etc/hosts
127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4
::1         localhost localhost.localdomain localhost6 localhost6.localdomain6
192.168.1.225   docker.ljj.cn
[root@localhost harbor]# vi harbor.cfg
hostname = docker.ljj.cn
ui_url_protocol = https
db_password = root123
max_job_workers = 3
customize_crt = on
ssl_cert = /data/cert/server.crt
ssl_cert_key = /data/cert/server.key
[root@localhost harbor]# mkdir -p /data/cert 
[root@localhost harbor]# cd /data/cert/
[root@localhost cert]# openssl genrsa -des3 -out server.key 2048
Generating RSA private key, 2048 bit long modulus
................+++
......................................................................+++
e is 65537 (0x10001)
Enter pass phrase for server.key:
Verifying - Enter pass phrase for server.key:  #密码123456
[root@localhost cert]# openssl req -new -key server.key -out server.csr
Enter pass phrase for server.key: #输入123456
You are about to be asked to enter information that will be incorporated
into your certificate request.
What you are about to enter is what is called a Distinguished Name or a DN.
There are quite a few fields but you can leave some blank
For some fields there will be a default value,
If you enter '.', the field will be left blank.
-----
Country Name (2 letter code) [XX]:CN
State or Province Name (full name) []:SX
Locality Name (eg, city) [Default City]:TY
Organization Name (eg, company) [Default Company Ltd]:ZDC
Organizational Unit Name (eg, section) []:ZDC
Common Name (eg, your name or your server's hostname) []:docker.ljj.cn
Email Address []:1350748936@qq.com

Please enter the following 'extra' attributes
to be sent with your certificate request
A challenge password []:   #直接回车
An optional company name []:   #直接回车
[root@localhost cert]# cp server.key server.key.org
[root@localhost cert]# openssl rsa -in server.key.org -out server.key
Enter pass phrase for server.key.org:     #退密码输入123456
writing RSA key
[root@localhost cert]# openssl x509 -req -days 365 -in server.csr -signkey server.key -out server.crt#转换成不带密码的证书。
Signature ok 
subject
=/C=CN/ST=SX/L=TY/O=ZDC/OU=ZDC/CN=docker.ljj.cn/emailAddress=1350748936@qq.com
Getting Private key

安装harbor

[root@localhost ~]# cd harbor
[root@localhost harbor]# ./install.sh

猜你喜欢

转载自www.cnblogs.com/liujunjun/p/12129566.html