Mac下快速安装Harbor

1. 环境准备

备注:必须先安装好Docker Desktop

Step1 :下载harbor-offline-installer-v2.11.0.tgz,下载地址为 https://github.com/goharbor/harbor/releases

Step2:解压,复制 harbor.yaml.tmplharbor.yml
在这里插入图片描述

Step3:在 /usr/local 目录下新建harbor文件夹,并赋予所有权限:

cd /usr/local
sudo mkdir harbor
sudo chmod +x harbor

Step4Docker Desktop也需要在Resource→FIle Sharing添加harbor目录,然后重启。
在这里插入图片描述

2. 配置

Step1:修改harbor.yml文件,主要修改几个部分的内容(分别为:域名、注释https、数据存储目录、日志存储目录):

......
hostname: reg.xxx.com ## harbor域名地址,一般格式为reg.xxx.com

# 把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


# The default data volume
data_volume: /usr/local/harbor/data


# 日志相关配置
log:
  # options are debug, info, warning, error, fatal
  level: info
  # configs for logs in local storage
  local:
    # Log files are rotated log_rotate_count times before being removed. If count is 0, old versions are removed rather than rotated.
    rotate_count: 50
    # Log files are rotated only if they grow bigger than log_rotate_size bytes. If size is followed by k, the size is assumed to be in kilobytes.
    # If the M is used, the size is in megabytes, and if G is used, the size is in gigabytes. So size 100, size 100k, size 100M and size 100G
    # are all valid.
    rotate_size: 200M
    # The directory on your host that store log
    location: /usr/local/harbor/data/log/harbor

Step2:hosts文件添加第四步骤的域名

127.0.0.1 host对应的域名

3. 安装

Step1:启动,执行install脚本

./install.sh

安装之后(这里忘记截图了),在Docker Desktop检查,看看harbor目录下哪些容器没有启动,直接手动再次启动即可。
在这里插入图片描述

4. 验证

浏览器访问刚才的域名,会跳转到登录页,账号密码问:admin / Harbor12345,密码可以在harbor.yml文件里面找到。
在这里插入图片描述
安装成功:
在这里插入图片描述
使用命令也能登录成功(注意:需要关闭本地的VPN,否则可能会访问不了):

docker login -u admin -p Harbor12345 reg.xxx.com

在这里插入图片描述

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值