离线安装Harbor

1.下载Harbor

https://github.com/goharbor/harbor/releases

harbor-online-installer-版本.tgz 为在线安装程序
harbor-offline-installer-版本.tgz 为离线安装程序

2.解压Harbor安装程序

tar -xvf harbor-offline-installer-版本.tgz

3.配置harbor.yml配置文件

3.1必要参数

下表列出了部署Harbor时必须设置的参数。默认情况下,所有必需的参数都不会在harbor.yml文件中注释。可选参数用注释#。您不一定需要从提供的默认值更改必需参数的值,但是这些参数必须保持注释。至少,您必须更新hostname参数。

cd harbor
cp harbor.yml.tmpl harbor.yml
vi harbor.yml

3.2修改hostname

这里内部服务器安装,不需要https证书,所以直接使用本机ip即可,并且注释https的配置

hostname: 192.168.28.140
#https:
  # https port for harbor, default is 443
  # port: 443
  # The path of cert and key files for nginx
  # certificate: /your/certificate/path
  # private_key: /your/private/key/path

4.运行harbor安装程序

sh install.sh

5.登录Harbor

登录地址:http://ip:prot

http://192.168.28.129:8001

默认用户吗和密码如下,建议登录后修改密码
用户名:admin
密码:Harbor12345

6.重启Harbor

systemctl stop docker
systemctl start docker
docker-compose up -d

7.设置Harbor开机自启动

编辑文件:vi /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
ExecStart=/usr/local/bin/docker-compose -f  /usr/local/harbor/docker-compose.yml up
ExecStop=/usr/local/bin/docker-compose -f /usr/local/harbor/docker-compose.yml down

[Install]
WantedBy=multi-user.target

重启

systemctl enable harbor
systemctl start harbor

你可能感兴趣的:(harbor)