安装harbor
mkdir -p /opt/harbor
cd /opt/harbor/
sudo wget https://github.com/goharbor/harbor/releases/download/v2.11.0/harbor-offline-installer-v2.11.0.tgz
tar xvf harbor-offline-installer-v2.11.0.tgz
cd harbor
cp harbor.yml.tmpl harbor.yml
vim harbor.yml
更改hostname
./install.sh
docker ps
cd /opt
mkdir images
cd images/
cd opt/
chmod 777 images/
docker load -i inspection-server_V1.0.1R1.1.46.tar
docker tag idc01-harbor.sxbychem.com/bestway/inspection-server:V1.0.1R1.1.46 10.20.111.113/test/inspection-server:V1.0.1R1.1.46
docker login 10.20.111.113
docker push 10.20.111.113/test/inspection-server:V1.0.1R1.1.46
在/etc/docker/daemon.json中同时添加10.20.111.113和10.20.111.113:80到不安全注册表列表,然后重启Docker服务
{
"insecure-registries": [
"10.20.111.113",
"10.20.111.113:80"
]
}
您的私有仓库(哈勃仓库)服务实际上监听在 HTTP 80端口。但Docker客户端在推送时,默认会先尝试连接 HTTPS 443端口。当连接443端口失败时(报no route to host),它还没来得及回退尝试80端口,整个流程就因网络错误而中断了。
docker tag moc-pcweb:0.38 10.20.111.113:80/test/moc-pcweb:0.38
docker push 10.20.111.113:80/test/moc-pcweb:0.38
http://10.20.111.113
admin
Harbor12345
浙公网安备 33010602011771号