https://docs.rancher.cn/rancher2x/install-prepare/download/compose.html#v1-25-4
下载docker-compose harbor-online
cp v1.25.4-docker-compose-Linux-x86_64 /usr/local/bin/docker-compose
chmod +x docker-compose
docker-compose --version
tar tar -xzvf harbor-online-installer-v1.10.1.tgz
cd /data/harbor/cert
openssl req
-newkey rsa:4096 -nodes -sha256 -keyout server.key
-x509 -days 3650 -out server.crt
-subj /C=CN/ST=BJ/L=BJ/O=DEVOPS/CN=hub.xxx.com
vim harbor.yml
hostname: hub.xxx.com
certificate: /data/harbor/cert/server.crt
private_key: /data/harbor/cert/server.key
data_volume: /data/harbor/data
./prepare
./install
开始、停止、重启harbor
cd /data/harbor
docker-compose ps/start/stop/restart
更新配置
docker-compose down -v (删除Harbor的容器,同时将镜像数据和Harbor的数据库文件保存在文件系统上)
vim harbor.yml
./prepare
./install
指定镜像仓库地址(自签名证书docker login仍然提示错误,须将ca.crt配至系统中或者配置insecure)
"insecure-registries": ["hub.xxx.com"]
"insecure-registries": ["172.28.11.200"]
参考
https://docs.rancher.cn/rancher2x/install-prepare/registry/configure-https.html#_1-%E8%8E%B7%E5%BE%97%E8%AF%81%E4%B9%A6
docker login k8s-rancher.zhcslyg.com -uadmin -ppassword