om/harbor/Harbor.md

1.1 KiB

需要安装docker和docker-compose https://goharbor.io/docs/2.9.0/install-config/

docker-compose

# 下载
wget https://github.com/docker/compose/releases/download/v2.20.2/docker-compose-linux-x86_64
# 设置可执行权限
chomd +x docker-compose-linux-x86_64
# 移动文件到
mv docker-compose-linux-x86_64 /usr/bin/docker-compose
# 查看版本
docker-compose -v

安装harbor

wget https://github.com/goharbor/harbor/releases/download/v2.8.3/harbor-offline-installer-v2.8.3.tgz
# 修改配置文件
harvor.yml
# 修改hostname
# 注销https
# 准备执行
./prepare
# 安装
./install

启动

https://goharbor.io/docs/2.9.0/install-config/run-installer-script/

# pwd
/software/harbor
# 启动
docker-compose up -d
# 停止
docker-compose down -v

push镜像使用http

# 修改配置文件
vi /etc/docker/daemon.json
{
"insecure-registries": ["hy-node4:80"],
"exec-opts": ["native.cgroupdriver=systemd"]
}
# 如果还是不行使用registry
docker run -d -p 5000:5000 --restart=always --name registry registry:2