下載
wget https://storage.googleapis.com/harbor-releases/release-1.9.0/harbor-online-installer-v1.9.0.tgz
解壓
tar zxvf harbor-online-installer-v1.9.0.tgz -C /usr/local/harbor/
修改harbor.yml 配置 密碼和hostname 等等
hostname: 64.64.224.xxx
harbor_admin_password: admin111
安裝
./install.sh
docker-compose start
? docker-compose -f /usr/local/harbor/docker-compose.yml ps
Name Command State Ports
---------------------------------------------------------------------------------------------
harbor-core /harbor/harbor_core Up (healthy)
harbor-db /docker-entrypoint.sh Up (healthy) 5432/tcp
harbor-jobservice /harbor/harbor_jobservice ... Up (healthy)
harbor-log /bin/sh -c /usr/local/bin/ ... Up (healthy) 127.0.0.1:1514->10514/tcp
harbor-portal nginx -g daemon off; Up (healthy) 8080/tcp
nginx nginx -g daemon off; Up (healthy) 0.0.0.0:80->8080/tcp
redis redis-server /etc/redis.conf Up (healthy) 6379/tcp
registry /entrypoint.sh /etc/regist ... Up (healthy) 5000/tcp
registryctl /harbor/start.sh Up (healthy)
界面
image.png
輸入用戶(hù)名密碼進(jìn)入
image.png
測(cè)試編譯docker 推上harbor倉(cāng)庫(kù)
docker login 64.64.224.xxx
docker build -t 64.64.224.xxx/library/mdn-love-day:2.0 .
docker push 64.64.224.xxx/library/mdn-love-day:2.0
image.png
錯(cuò)誤情況
1
WARNING: no logs are available with the 'syslog' log driver
docker info 查看logdrive是那一種份蝴,比如我的是json-file
則修改docker-compose.yml中的drive 到對(duì)應(yīng)的drive: json-file
2
docker login docker.xx.com 登錄不上
Error response from daemon: Get https://docker.yishi.tech/v2/: http: server gave HTTP response to HTTPS client
vim /etc/docker/daemon.json
加入
{
"insecure-registries": ["docker.xx.com"]
}
systemctl restart docker