赞
踩
一、关停harbor服务
cd /data/harbor_install_1.10.2
docker-compose down 关停harbor
二、上传获取harbor_v2.2.2包
https://github.com/goharbor/harbor/releases/tag/v2.2.2 下载包,并上传到服务器
mkdir /data/harbor_install_2.2.2 -p
cd /data/harbor_install_2.2.2
#安装包已上传到目录中/data/harbor_install_2.2.2
tar zxvf harbor-offline-installer-v2.2.2.tgz
cd harbor
docker load -i harbor.v2.2.2.tar.gz
二、备份数据
cd /data
mkdir harbor_bak
mv /data/harbor/registry /data/harbor_bak/
cp -rf /data/harbor/* /data/harbor_bak/
三、迁移配置文件
docker run -it --rm -v /:/hostfs goharbor/prepare:v2.2.2 migrate -i /data/harbor_install_1.10.2/harbor/harbor.yml -o /data/harbor_install_2.2.2/harbor.yml
migrating to version 2.0.0
migrating to version 2.1.0
migrating to version 2.2.0
Written new values to /data/harbor_install_2.2.2/harbor.yml
四、启动新的harbor
cd /data/harbor_install_2.2.2/ ./install.sh --with-chartmuseum --with-trivy Creating network "harbor_install_222_harbor" with the default driver Creating network "harbor_install_222_harbor-chartmuseum" with the default driver Creating harbor-log ... done Creating harbor-portal ... done Creating redis ... done Creating chartmuseum ... done Creating registry ... done Creating registryctl ... done Creating harbor-db ... done Creating harbor-core ... done Creating trivy-adapter ... done Creating nginx ... done Creating harbor-jobservice ... done ✔ ----Harbor has been installed and started successfully.----
五、把旧的registry 迁回
cd /data/harbor_install_2.2.2/
#关停新的harbor
docker-compose down
#把registry迁回
mv /data/harbor_bak/registry /data/harbor
#启动harbor
cd /data/harbor_install_2.2.2/
docker-compose up -d
六、验证
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。