https://github.com/goharbor/harbor/releases?page=2
https://github.com/goharbor/harbor/releases/download/v2.3.4/harbor-offline-installer-v2.3.4.tgz
harbor官网:https://goharbor.io/
点击 Download now 链接,会自动跳转到上述github页面,但是网速不行,尝试用服务器下载:
在服务器上:
[root@VM-24-17-centos ~]# wget https://github.com/goharbor/harbor/releases/download/v2.3.4/harbor-offline-installer-v2.3.4.tgz
经过漫长的等待。。。
安装前说明:harbor依赖docker 和 docker-compose
所以服务器上要安装好docker + docker compose
解压:
bash
[root@VM-24-17-centos harbor]# cp harbor.yml.tmpl harbor.yml
[root@VM-24-17-centos harbor]# vim harbor.yml
修改项如下:
- 域名+端口
hostname: 101.43.xxx.xx
port: 3306
因为特殊原因,80端口用于转发请求到es, 6379用于mysql从库,3306原本用于gaussdb,现在停了所以用3306端口(就这么神奇~)
bash
mac使用nc,windows使用telnet命令:
jelex@jelexxudeMacBook-Pro ~ % nc -zv 101.43.xxx.xx 3306
nc: connectx to 101.43.xxx.xx port 3306 (tcp) failed: Connection refused
jelex@jelexxudeMacBook-Pro ~ % nc -zv 101.43.xxx.xx 6379
Connection to 101.43.xxx.x port 6379 [tcp/*] succeeded!
jelex@jelexxudeMacBook-Pro ~ % nc -zv 101.43.xxx.xx 80
Connection to 101.43.xxx.x port 80 [tcp/http] succeeded!
jelex@jelexxudeMacBook-Pro ~ %
- 注释掉https
- 修改密码
harbor_admin_password: as you will... - 默认数据存在目录
启动:[root@VM-24-17-centos harbor]# ./install.sh
。。。 。。。
发现多了一堆容器:
跳转如下页面:
修改docker主机配置文件,使docker支持harbor
bash
[root@VM-24-17-centos harbor]# vim /etc/docker/daemon.json
FYI:"registry-mirrors": ["https://mirror.ccs.tencentyun.com"]
[root@VM-24-17-centos harbor]# cat /etc/docker/daemon.json
{
"registry-mirrors": ["https://mirror.ccs.tencentyun.com"],
"insecure-registries":["101.43.141.9:3306"]
}
重启docker:
[root@VM-24-17-centos harbor]# systemctl restart docker
设置 harbor 开启启动
vim /lib/systemd/system/harbor.service
[Unit]
Description=Harbor
After=docker.service systemd-networkd.service systemd-resolved.service
Requires=docker.service
Documentation=http://github.com/vmware/harbor
[Service]
Type=simple
Restart=on-failure
RestartSec=5
# 需要注意 harbor 的安装位置
ExecStart=/usr/local/bin/docker-compose -f /root/harbor/docker-compose.yml up
ExecStop=/usr/local/bin/docker-compose -f /root/harbor/docker-compose.yml stop
[Install]
WantedBy=multi-user.target
必须使用 docker-compose up 命令启动
bash
systemctl daemon-reload
systemctl enable harbor # 开机自启
systemctl start harbor # 启动
harbor使用: