# 1. harbor地址github
https://github.com/goharbor/harbor
# harbor证书生成
https://goharbor.io/docs/2.0.0/install-config/configure-https/
openssl genrsa -out ca.key 4096
openssl req -x509 -new -nodes -sha512 -days 3650 \
-subj "/C=CN/ST=Shanghai/L=Shanghai/O=harbor/OU=test/CN=test.com" \
-key ca.key \
-out ca.crt
mkdir -p /opt/harbor/certs
mv ca.key ca.crt /opt/harbor/certs
# harbor安装
# 2. 下载harbor离线安装包
https://github.com/goharbor/harbor/releases/tag/v2.1.0
# 3. 解压harbor安装包
tar -xf harbor-offline-installer-v2.1.0.tgz -C /opt
# 4. 修改harbor配置文件
cd harbor
cp harbor.yml.tmpl harbor.yml
```
# 修改http port为21080
# 修改https port为21443
# 修改hostname为harbor.test.com
# 修改data_volume为/opt/harbor/data
# 修改certificate为https证书路径/opt/harbor/certs/ca.crt
# 修改private_key为https私钥路径/opt/harbor/certs/ca.key
```
# 5. 通过daocloud安装docker-compose
curl -L https://get.daocloud.io/docker/compose/releases/download/1.27.4/docker-compose-`uname -s`-`uname -m` > /usr/local/bin/docker-compose
chmod +x /usr/local/bin/docker-compose
# 6. 安装harbor
# --with-chartmuseum 为helm的chart仓库 --with-clair为镜像扫描工具 --with-notary为安全性设置
./install.sh --with-notary --with-clair --with-chartmuseum