环境:centos7.4
Harbor1.6
关闭防火墙和SELinux
因为要使用HTTPS协议,没有证书,只能本地生产一个
openssl genrsa -out /root/certs/ca.key 2048
默认证书有效期一年 -days选项可以指定证书有效期
openssl req -x509 -new -nodes -key /root/certs/ca.key -subj "/CN=docker.ehaofang.net" -days 6700 -out /root/certs/ca.crt
查看证书有效期时间
[root@Docker-Registry certs]# openssl x509 -in ca.crt -noout -dates
notBefore=Oct 23 05:52:07 2019 GMT
notAfter=Feb 25 05:52:07 2038 GMT
安装Harbor
wget https://storage.googleapis.com/harbor-releases/release-1.6.0/harbor-offline-installer-v1.6.0.tgz
tar -zxvf harbor-offline-installer-v1.6.0.tgz -C /opt/
cd /opt/harbor
更改配置文件
vim harbor.cfg
hostname = docker.ehaofang.net
ui_url_protocol = https
ssl_cert = /root/certs/ca.crt
ssl_cert_key = /root/certs/ca.key
harbor_admin_password =修改默认密码
启动harbor,此过程比较慢因为要下载镜像
./prepare
./install.sh