harbor搭建
docker安裝
yum install docker
systemctl start docker
安裝docker-compose
yum install docker-compose
harbor安裝
下載harbor安裝包https://github.com/goharbor/harbor/releases
wget https://storage.googleapis.com/harbor-releases/release-1.8.0/harbor-offline-installer-v1.8.0.tgz tar -zxvf harbor-offline-installer-v1.8.0.tgz cd harbor
vim harbor.yml
#修改如下幾項
hostname = 你本機的IP
harbor_admin_password = admin賬號的密碼
./install.sh
docker login harbor.doutery.club:81驗證
如果走https協議驗證失敗的話可以
vi /usr/lib/systemd/system/docker.service
#添加http協議
ExecStart=/usr/bin/dockerd -H fd:// --containerd=/run/containerd/containerd.sock --insecure-registry= http://harbor.doutery.club:81 systemctl daemon-reload systemctl restart docker.service
上傳鏡像到harbor
docker login harbor.doutery.club:81 docker ps #標記鏡像 docker tag google/cadvisor:latest harbor.doutery.club:81/library/mycadvisor:1.1 #推送鏡像 docker push harbor.doutery.club:81/library/mycadvisor:1.1