先安装docker
yum install -y yum-utils device-mapper-persistent-data lvm2
yum-config-manager --add-repo https://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
systemctl start docker.service systemctl enable docker.service
yum install -y docker-ce docker-ce-cli containerd.io
vim /opt/harbor/harbor.yml
openssl genrsa -des3 -out server.key 2048
openssl genrsa :生成密钥 RSA
-des3:加密的算法 Triple DES加密的算法,生成的私钥进行加密
-out server.key 生成私钥文件
2048:密钥的位数是2048
openssl rsa -in server.key.old -out server.csr
cp server.key server.key.old
chmod 777 server.*
/prepare
./install.sh
第二台机器也需要docker
mkdir -p /etc/docker/certs.d/hub.test.com
docker pull nginx
回到第一台docker上
cd /
scp -r data/ root@20.0.0.62:/
再回到第二台docker上
docker pull nginx
cp server.crt server.csr server.key /etc/docker/certs.d/hub.test.com/
vim /lib/systemd/system/docker.service
systemctl daemon-reload
systemctl restart docker
yum -y install telnet
telnet hub.test.com 443
docker tag nginx:latest hub.test.com/library/nginx:wqb
docker login -u admin -p 123456 https://hub.test.com
docker push hub.test.com/library/nginx:wqb