下載安裝包
wget https://github.com/goharbor/harbor/releases/download/v2.1.5/harbor-offline-installer-v2.1.5.tgz
在線安裝gpg公鑰
gpg -v --keyserver hkps://keyserver.ubuntu.com --verify harbor-online-installer-version.tgz.asc tar xzvf harbor-online-installer-version.tgz
離線安裝gpg公鑰
gpg -v --keyserver hkps://keyserver.ubuntu.com --verify harbor-offline-installer-version.tgz.asc tar xzvf harbor-offline-installer-version.tgz
執行安裝腳本
./install.sh
客戶端docker通過http連接harbor
vi /etc/docker/daemon.json
{ "insecure-registries":["reg.itnotetk.com:5000"] }
vi /etc/default/docker
OPTIONS='--insecure-registry reg.itnotetk.com:5000'
重啟Docker服務
systemctl restart docker
停止harbor
docker-compose down -v
重啟harbor
docker-compose up -d
登入私有reg
root@docker-test3:/opt# docker login reg.itnotetk.com:5000 Username: admin Password: WARNING! Your password will be stored unencrypted in /root/.docker/config.json. Configure a credential helper to remove this warning. See https://docs.docker.com/engine/reference/commandline/login/#credentials-store Login Succeeded
上傳image
docker pull ubuntu:14.04 docker tag ubuntu:14.04 reg.itnotetk.com:5000/library/ubuntu:14.04 docker push reg.itnotetk.com:5000/library/ubuntu:14.04
下載image
docker pull reg.itnotetk.com:5000/library/ubuntu:14.04
參考網址
https://goharbor.io/docs/2.2.0/install-config/run-installer-script/