证书是自定义颁发。私立密钥(因此访问某些网站会显示网站不安全)
拖入docker-compose
docker-harbor 安装包
mv docker-com... docker-compose
mv docker-compose /usr/local/bin/
chmod 777 /usr/local/bin/docker-compose
安装docker
tar -xf harbor....
cp harbor.yml.tmpl harbor.yml
hostname: hub.test.com
这次https不注释
certificate: /data/cert/server.crt
证书
private_key: /data/cert/server.key
私立密钥
修改密码
cd /data/cert
openssl genrsa -des3 -out server.key 2048
openssl genrsa:生成密钥,通过rsa的方式
-des3:加密算法,Triple DES加密的算法,生成的私钥进行加密
-out server.key:生成私钥文件
2048:密钥的位数是2048
生成声明证书请求文件
openssl req -new -key server.key -out server.csr
123456
CN
JS
NJ
TEST
hub.kgc.com
admin@test.com
其他的全部回车
把key做备份
cp server.key server.key.old
openssl rsa -in server.key.old -out server.key
123456
生成签名证书即可
openssl x509 -req -days 1000 -in server.csr -signkey server.key -out server.crt
chmod 777 server.*
cd /opt
cd harbor
./prepare
./install
harbor安装好之后
test2
安装docker
systemctl stop firewalld
setenforce 0
systemctl restart docker
mkdir -p /etc/docker/certs.d/hub.test.com
test1
scp -r data/ root@20.0.0.62:/
yes
123
test2
docker pull nginx
cd /data
cd cert
cp server.crt server.csr server.key /etc/docker/certs.d/hub.test.com/
cd /etc/docker/cert.s/hub.test.com/
vim /lib/systemd/system/docker.service
--insecure-registry=hub.test.com
systemctl restart docker
vim /etc/hosts
192.168.233.10 hub.test.com
安装测试工具
test2
yum -y install telnet
docker tag nginx:latest hub.test.com/library/nginx:zzr
docker login -u admin -p 123456 https://hub.test.com
docker push hub.test.com/library/nginx:zzr