官方文档入口
配置harbor.yml
1
2
3
4
5
| wget https://github.com/goharbor/harbor/releases/download/v2.5.0/harbor-offline-installer-v2.5.0.tgz
tar zxf harbor-offline-installer-v2.5.0.tgz && cd harbor
cp harbor.yml.tmpl harbor.yml
|
harbor.yml参考
1
2
3
4
5
6
7
8
9
10
| hostname: harbor.example.com
http:
port: 8080
external_url: https://harbor.example.com
harbor_admin_password: Harbor12345
database:
password: root123
max_idle_conns: 100
max_open_conns: 900
data_volume: /data/harbor
|
安装和运行
1
2
| sudo ./install.sh --with-trivy
sudo docker-compose up -d
|
如果修改harbor.yml后,需要执行prepare
1
2
3
| sudo ./prepare --with-trivy
sudo docker-compose down -v
sudo docker-compose up -d
|
配置nginx反代
略
如果是自签名ssl证书(由私有CA签发),使用此镜像仓库的docker需要信任ssl证书,信任CA即可
1
2
| sudo mkdir -p /etc/docker/certs.d/harbor.example.com
sudo cp ca.crt /etc/docker/certs.d/harbor.example.com/
|