百度雲地址:https://pan.baidu.com/s/1kbhQtICQZjAYAwxhsx4Q1Q 提取碼:v2xhmysql
tar -zxvf harbor-offline-installer-v1.2.0.tgz mv harbor /usr/local cd /usr/local/harbor ls 查看
vi harbor.cfg #改成你想要修改的域名 hostname = hub.test.com #修改成https協議 ui_url_protocol = https #默認的私鑰公鑰配置文件 ssl_cert = /data/cert/server.crt ssl_cert_key = /data/cert/server.key #默認的登陸密碼 harbor_admin_password = Harbor12345
openssl genrsa -des3 -out server.key 2048
openssl req -new -key server.key -out server.csr
cp server.key server.key.org
openssl rsa -in server.key.org -out server.key
openssl x509 -req -days 365 -in server.csr -signkey server.key -out server.crt mkdir /data/cert chmod -R 777 /data/cert
mv server.* /data/cert
修改hosts文件方便域名解析
echo 「ip hub.test.com」 >> /etc/hosts
同理修改windows的hosts文件
C:\Windows\System32\drivers\etc
修改docker下的文件以便成功訪問
vi /etc/docker/daemon.json
{
"registry-mirrors": ["https://3tcts5g3.mirror.aliyuncs.com"],
"insecure-registries": ["你的harbor服務器 ip"],
"insecure-registries": ["https://hub.test.com"]
}sql
重啓docker
systemctl restart docker
移動到harbor目錄 cd /usr/local/harbor
./install.sh
#查看運行的harbor
docker ps
推送和下載鏡像docker
docker login https://hub.test.com輸入用戶名和密碼docker tag mysql hub.test.com/library/my_mysql:v1.0docker push my_mysql:v1.0