harbor registry 总结 (修改80端口)

基本搭建

harbor 基本搭建流程(转)

修改非标准端口

harbor 修改非标准端口 (转)

整个流程需要掌握以下几个:

  • nginx 的反向代理(proxy)
  • docker-compose 配置知识
  • yml 语法
  • docker 基本操作

http请求问题 2种解决方案

1、nginx配置ssl证书 (没有实际操作,大概以下几个步骤)
1) 申请域名和免费ssl证书 腾讯云
2) nginx 配置域名和证书

 listen 443 ssl;
        server_name abc.cn;
        ssl_ciphers             ECDHE-RSA-AES128-GCM-SHA256:ECDHE:ECDH:AES:HIGH:!NULL:!aNULL:!MD5:!ADH:!RC4;
        ssl_protocols           TLSv1 TLSv1.1 TLSv1.2;
        ssl_certificate         /sslcrt/abc/Nginx/1_abc.cn_bundle.crt;
        ssl_certificate_key     /sslcrt/abc/Nginx/2_abc.cn.key;
        ssl_prefer_server_ciphers       on;
        ssl_session_cache               shared:SSL:1m;
        ssl_session_timeout             5m;

3) nginx 反向代理到 registry:5000

  upstream registry {
             server registry:5000
   }
 -----------------------------------------------
 location / {
 	proxy_pass   http://registry;
 }
方法一、https实现
  • 准备相关域名和ssl证书各一份
  • 修改 harbor.cfg
  • 第7行 hostname = you.example.com
  • 第23行ssl_cert = /home/sslcrt/d/Nginx/1_you.example.com_bundle.crt
  • 第24行ssl_cert_key = /home/sslcrt/d/Nginx/2_you.example.com.key
  • 执行shell脚本 ./install.sh其他的 harbor 都为我们做好了
## Configuration file of Harbor

#This attribute is for migrator to detect the version of the .cfg file, DO NOT MODIFY!
_version = 1.5.0
#The IP address or hostname to access admin UI and registry service.
#DO NOT use localhost or 127.0.0.1, because Harbor needs to be accessed by external clients.
hostname = you.example.com

#The protocol for accessing the UI and token/notification service, by default it is http.
#It can be set to https if ssl is enabled on nginx.
ui_url_protocol = https

#Maximum number of job workers in job service
max_job_workers = 50

#Determine whether or not to generate certificate for the registry's token.
#If the value is on, the prepare script creates new root cert and private key
#for generating token to access the registry. If the value is off the default key/cert will be used.
#This flag also controls the creation of the notary signer's cert.
customize_crt = on

#The path of cert and key files for nginx, they are applied only the protocol is set to https
ssl_cert = /home/sslcrt/d/Nginx/1_you.example.com_bundle.crt
ssl_cert_key = /home/sslcrt/d/Nginx/2_you.example.com.key
...
方法二、非https 更改配置,如下 (centos7.2)
//step1
vi /etc/docker/daemon.json 
//step2
json中加入  
"insecure-registries":["189.189.189.189:3000"]
//step3
systemctl restart docker

若看到

docker login 189.189.189.189:3000
Username: admin
Password: 
Login Succeeded

恭喜!

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值