安装harbor

1. 首先安装好docker,这里不再赘述。可以参考:https://www.jianshu.com/p/e6005f615989

2. 到github下载harbor的安装包,这里下载v2.11.1版本

wget  https://github.com/goharbor/harbor/releases/download/v2.11.1/harbor-online-installer-v2.11.1.tgz

3. 解压(在root目录下)

tar xf  harbor-online-installer-v2.11.1.tgz

4. 修改配置文件

vim   harbor.yml

hostname   192.168.100.31
harbor_admin_password: 123456
https相关的部分注释掉

  #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
    # enable strong ssl ciphers (default: false)
    # strong_ssl_ciphers: false

 

5. 安装 

cd  /root/harbor

./install.sh

6.创建systemd服务管理脚本 [先安装docker-compose]

安装docker-compose

pip3  install docker-compose -i  https://mirrors.aliyun.com/pypi/simple/ 

[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=docker-compose -f /root/harbor/docker-compose.yml up  -d
ExecReload=docker-compose -f /root/harbor/docker-compose.yml restart
ExecStop=docker-compose -f  /opt/harbor/docker-compose.yml down
 
[Install]
WantedBy=multi-user.target

参考链接:https://blog.51cto.com/u_16213577/10401868

posted @ 2024-10-01 15:24  羊脂玉净瓶  阅读(25)  评论(0)    收藏  举报