docker搭建Harbor镜像仓库之HTTPS

环境: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

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值