部署环境
Ubuntu 22.04 LTS
已经安装了docker 原则上跟docker版本关系不大从
v2.5.3
迁移到v2.9.0
版本上,保留原来的镜像仓库数据
参考资料&踩坑指南
全新部署参见
部署harbor
迁移步骤
# 数据目录复制过来
cp -rf /dataM/harbor /opt/harbor
cd /usr/local/harbor/
tar zxvf harbor-offline-installer-v2.9.0.tgz
rm harbor-offline-installer-v2.9.0.tgz
mv harbor/* ../harbor
cp harbor.yml.tmpl harbor.yml
#修改配置文件 --配置域名,存储
vim harbor.yml
./prepare
# 修改yml文件-配置网络
vim docker-compose.yml
networks:
harbor:
external: false
driver: bridge
ipam:
driver: default
config:
- subnet: "192.168.70.0/24"
./install.sh
docker compose down -v
docker compose up -d
# 测试
docker pull ubuntu:22.04
docker tag ubuntu:22.04 registry.example.com/library/ubuntu:22.04
docker push registry.example.com/library/ubuntu:22.04
docker rmi registry.example.com/library/ubuntu:22.04
docker pull registry.example.com/library/ubuntu:22.04