1.安装环境
下载离线安装包地址
https://github.com/vmware/harbor/releases/
yum install -y docker
pip install -i https://pypi.tuna.tsinghua.edu.cn/simple docker-compose
2.修改harbor.cfg
hostname = yourname.yourname.com
customize_crt = off
3.制作私有证书
mkdir -p /data/cert/
cd /data/cert/
localdomain=node77.ityunv.com
openssl req -nodes -subj "/C=CN/ST=Beijing/L=Beijing/CN=$localdomain" -newkey rsa:2048 -keyout $localdomain.key -out $localdomain.csr
openssl x509 -req -days 3650 -in $localdomain.csr -signkey $localdomain.key -out $localdomain.crt
openssl x509 -req -in $localdomain.csr -CA $localdomain.crt -CAkey $localdomain.key -CAcreateserial -out $localdomain.crt -days 3650
mv $localdomain.crt server.crt
mv $localdomain.key server.key
或者 交互式
cd /data/cert
openssl req -newkey rsa:2048 -nodes -keyout server.key -x509 -days 3650 -out server.pem
cat server.pem |tee -a server.crt
rm -f server.pem
4.安装harbor
cd /opt/harbor/
./install.sh
5.验证
出现以下提示说明harbor仓库已部署完毕
✔ ----Harbor has been installed and started successfully.----
Now you should be able to visit the admin portal at https://yourname.yourname.com .
For more details, please visit https://github.com/vmware/harbor .
6.默认用户
admin/Harbor12345