1.首先配置docker环境
网络和yum源
]# cd /etc/yum.repos.d
]# vim docker.repo
docker
name=docker-ce
baseurl=https://mirrors.aliyun.com/docker-ce/linux/rhel/9/x86_64/stable
gpgcheck=0
yum install docker-ce -y
做一个加密认证
openssl req -newkey rsa:4096 \
-nodes -sha256 -keyout certs/timinglee.org.key \
-addext "subjectAltName = DNS:reg.timinglee.org" \ #指定备用名称
-x509 -days 365 -out certs/timinglee.org.crt
导入harbor仓库源码包
然后解压缩
tar zxvf harbor-offline-installer-v2.5.4.tgz
cd harbor/
cp harbor.yml.tmpl harbor.yml
vim harbor.yml
cp /root/certs/ /data/ -r #把加密文件复制到配置文件中写的位置
为什么要到/data/ 因为配置文件中写到自动将其挂载到/data/

./install.sh --with-chartmuseum
docker compose up -d 进行安装配置
docker compose stop
docker compose down
在c盘windows下的 system32/drives/etc/hosts做地址解析

harbor仓库构建成功
可能遇到的问题:web界面可以访问 但终端不行
可以 docker compose down
然后重新构建docker compose up -d
如果证书有问题 忽略验证证书 但是不推荐
在/etc/docker/daemon.json 添加
{
"insecure-registries" : ["reg.timinglee.org"]
}
然后重启docker服务