Harbor部署

下载harbor安装包:

      这边下载的是2.4.1版本

      https://github.com/goharbor/harbor/releases/download/v2.4.1/harbor-offline-installer-v2.4.1.tgz

解压harbor离线版安装包

tar xf harbor-offline-installer-v2.4.1.tgz
mv harbor /var/docker

修改harbor安装的配置文件 

cd /var/docker/harbor
mv harbor.yml.tmpl  harbor.yml  
mkdir -p /apps/harbor/data        //用于存放harbor的持久化数据
 
harbor.yml配置文件主要修改参数如下:
 
hostname: testing.com ///设置访问地址,可以使用ip、域名,不可以设置为127.0.0.1或localhost
 
http:
  # port for http, default is 80. If https enabled, this port will redirect to https port
  port: 8080   //设置端口
 
# https related config    //配置(如不需要可不配置,注释掉)
#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
 
harbor_admin_password: Harbor12345         //admin密码,可修改为其他密码
 
# The default data volume
data_volume: /apps/harbor/data   //配置harbor持久化数据存放路径

安装并启动Harbor

./install.sh

 安装完成后,平台docker容器正常运行

 调整nginx配置

用域名登陆失败,docker login testing.com 失败,查阅资料,修改nginx配置文件得以解决

docker exec -it nginx bash
cd /etc/nginx
vi nginx.conf
 
#nginx.conf配置文件
#  location / ;location /v2/ ;location /service/ 三个都添加 proxy_set_header X-Forwarded-Proto https;
 
#location /添加 proxy_set_header X-Forwarded-Proto https;
location / {
      proxy_pass http://portal/;
      proxy_set_header Host $host;
      proxy_set_header X-Real-IP $remote_addr;
      proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
      #proxy_set_header X-Forwarded-Proto $x_forwarded_proto;
      proxy_set_header X-Forwarded-Proto https;
 
      proxy_buffering off;
      proxy_request_buffering off;
    }
 
#location /v2/添加 proxy_set_header X-Forwarded-Proto https;
location /v2/ {
      proxy_pass http://core/v2/;
      proxy_set_header Host $http_host;
      proxy_set_header X-Real-IP $remote_addr;
      proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
      #proxy_set_header X-Forwarded-Proto $x_forwarded_proto;
      proxy_set_header X-Forwarded-Proto https;
      proxy_buffering off;
      proxy_request_buffering off;
 
      proxy_send_timeout 900;
      proxy_read_timeout 900;
    }
 
#location /service/添加 proxy_set_header X-Forwarded-Proto https;
location /service/ {
      proxy_pass http://core/service/;
      proxy_set_header Host $host;
      proxy_set_header X-Real-IP $remote_addr;
      proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
      #proxy_set_header X-Forwarded-Proto $x_forwarded_proto;
      #proxy_set_header X-Forwarded-Proto $x_forwarded_proto;
      proxy_set_header X-Forwarded-Proto https;
 
      proxy_buffering off;
      proxy_request_buffering off;
    }

访问Harbor

 http://testing.com  admin    Harbor12345

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值