nginx外网 + harbor拉取推送镜像
文章目录
- 1,问题描述
- 2,问题解决
1,问题描述
nginx外网 + harbor nginx容器配置:
外网nginx代理后harbor域名:harbor01.io harbor.cfg ( hostname = 192.168.56.72 ) ---> pull harbor01.io/xx/yy errharbor.cfg ( hostname = harbor01.io ) ---> pull harbor01.io/xx/yy ok, push errcommon/config/nginx/nginx.conf 修改配置/ , /v2/ , /service/ (proxy_set_header X-Forwarded-Proto https) ---> push harbor01.io/xx/yy ok, pull err
能pull镜像,但是push 镜像出现的问题:unauthorized: authentication required
[root@c7 wrapper-linux-x86-64-3.5.49]# docker push harbor01.io/kuai/nginx
The push refers to repository [harbor01.io/kuai/nginx]
d9eb91d66e2a: Pushing [==================================================>] 3.584kB
ae1f545e4c08: Pushing [=============> ] 512B/1.961kB
c20672db3628: Pushing [==================================================>] 3.072kB
4cbb728cd302: Preparing
9eb82f04c782: Preparing
unauthorized: authentication required
2,问题解决
参考:https://www.cnblogs.com/chenminklutz/p/13446164.html
- 把X-Forwarded-Proto设置为https,临时解决外网push镜像问题
- 把X-Forwarded-Proto还原,临时解决pull镜像问题
#################### docker客户端pull / push 镜像
[root@c7 ~]# docker push harbor01.io/kuai/nginx
The push refers to repository [harbor01.io/kuai/nginx]
d9eb91d66e2a: Pushing [==================================================>] 3.584kB
ae1f545e4c08: Pushing [=============> ] 512B/1.961kB
c20672db3628: Pushing [==================================================>] 3.072kB
4cbb728cd302: Preparing
9eb82f04c782: Preparing
unauthorized: authentication required#################### harbor服务端
#1,修改harbor.cfg ,把hostname改为与外网nginx一致的代理域名
[root@JXQ-11-243-32-211 harbor]# grep hostname /export/harbor/harbor.cfg
#hostname = 192.168.56.72
hostname = harbor01.io#2,修改harbor nginx容器配置
[root@JXQ-11-243-32-211 harbor]# cd common/config/nginx/
[root@JXQ-11-243-32-211 nginx]# ll
total 32
drwx------ 2 65534 root 4096 Apr 18 15:57 client_body_temp
drwxr-xr-x 2 root root 4096 Apr 18 15:57 conf.d
drwx------ 2 65534 root 4096 Apr 18 15:57 fastcgi_temp
-rw-r----- 1 root root 3353 Apr 25 09:35 nginx.conf
-rw-r----- 1 root root 3654 Apr 22 15:21 nginx.conf.bak
drwx------ 2 65534 root 4096 Apr 18 15:57 proxy_temp
drwx------ 2 65534 root 4096 Apr 18 15:57 scgi_temp
drwx------ 2 65534 root 4096 Apr 18 15:57 uwsgi_temp# 备份原有的配置文件 .ori , 然后修改nginx.conf
[root@JXQ-11-243-32-211 harbor]# cp common/config/nginx/nginx.conf common/config/nginx/nginx.conf.ori
[root@JXQ-11-243-32-211 harbor]# cp common/config/nginx/nginx.conf common/config/nginx/nginx.conf.https
[root@JXQ-11-243-32-211 harbor]# vim common/config/nginx/nginx.conf.https
# 修改配置/ , /v2/ , /service/
# (proxy_set_header X-Forwarded-Proto https) ---> pull harbor01.io/xx/yy err, push ok
[root@JXQ-11-243-32-211 harbor]# grep 'X-Forwarded-Proto' common/config/nginx/nginx.conf.https proxy_set_header X-Forwarded-Proto https;proxy_set_header X-Forwarded-Proto $scheme;proxy_set_header X-Forwarded-Proto $scheme;proxy_set_header X-Forwarded-Proto $scheme;proxy_set_header X-Forwarded-Proto https;proxy_set_header X-Forwarded-Proto https;[root@JXQ-11-243-32-211 harbor]# cd common/config/nginx/
[root@JXQ-11-243-32-211 nginx]# ln -sf nginx.conf.https nginx.conf
[root@JXQ-11-243-32-211 nginx]# ll
total 32
drwx------ 2 65534 root 4096 Apr 18 15:57 client_body_temp
drwxr-xr-x 2 root root 4096 Apr 18 15:57 conf.d
drwx------ 2 65534 root 4096 Apr 18 15:57 fastcgi_temp
lrwxrwxrwx 1 root root 14 Apr 25 10:14 nginx.conf -> nginx.conf.https
-rw-r----- 1 root root 3647 Apr 25 10:14 nginx.conf.https
-rw-r----- 1 root root 3653 Apr 25 09:40 nginx.conf.ori[root@JXQ-11-243-32-211 nginx]# docker restart nginx
nginx外网 + harbor拉取推送镜像相关推荐
- 【K8S】Docker向私有仓库拉取/推送镜像报错(http: server gave HTTP response to HTTPS client)
这里,我们搭建的Harbor仓库的地址为 http://192.168.175.101:1180. 报错信息如下所示. [root@binghe101 ~]# docker login 192.168 ...
- 微信小程序开发工具 将已存在的Git项目在新开发者下拉取推送
微信小程序开发工具 将已存在的Git项目在新开发者下拉取推送 前言 流程 完事 前言 最近有同事离职了,交接了一个微信小程序的项目下来,源码放在了公司内部的GIT上面,当我下载下来维护之后发现,在微信 ...
- (SVN+SSH)搭建SVN并使用SSH进行免密拉取推送代码
[SVN+SSH]搭建SVN并使用SSH进行免密拉取推送代码 一.安装svn.openssh-server服务 二.开启svn服务,创建测试仓库,并能通过账号密码拉取 定义svn仓库文件位置 创建仓库 ...
- 5.docker从指定(私有)仓库拉取镜像、推送镜像
1.推送镜像到私有仓库 1.1修改配置daemon.json 由于我用的mac系统,直接在docker客户端配置私有仓库地址即可.配置完之后记得重启docker. 1.2 给镜像打标签 举例将从官方仓 ...
- [基于harbor部署私有仓库] 4 推送镜像到harbor
目录 1 场景解释 2 配置推送docker 3 推送 3.1 准备 3.2 标记镜像 3.3 登录docker(可省) 3.4 推送镜像 3.5 查看 4 参考 5 你们可能遇到的问题 5.1 se ...
- 如何正确推送镜像到私有仓库Harbor(http方式)
1 缘起 部署了Harbor之后,就要推送镜像, 为后续K8S拉取镜像做准备. 由于是测试环境,因此使用http方式推送镜像. 但是,推送镜像到Harbor过程中,遇到了一系列问题, 遇到一个解决一个 ...
- [Docker]Docker拉取,上传镜像到Harbor仓库
需求 因为项目的需求,需要制作一个基于tomcat的镜像.那么前提就是,需要有tomcat的基础镜像. 怎么做 我的思路跑偏了,本来以为是需要将tomcat下载下来,然后通过docker命令,让它成为 ...
- docker 从harbor 拉取镜像慢_Harbor丨使用的正确姿势
跟着我入门 本次内容带来的是带各位同学如何使用harbor作为自己或者企业的仓库.会更多通过干货的形式分享给你们,例如安装需求,安装事项,安装步骤等. 1-环境要求 docker.io(建议版本16以 ...
- jenkins自动打包并向Harbor推送镜像
记录, 使用jenkins自动打包并向私库推送镜像, 不限制于Harbor.该问题因为一个小点没有想到, 导致调查了一天,多次尝试,阅读大量相关的文章并未解决作者的问题. 所以作为记录,供读者多一个参 ...
最新文章
- ricker 子波matlab,毕设求助!!!雷克子波合成地震信号
- python 优化加速方案
- 【必看】谈谈变更过程中的运维意识
- vs2019中如何创建qt项目_VS2019创建新项目居然没有.NET Core3.0的模板?
- oui unknown中的oui是什么?
- exc_bad_instruction(code=EXC_I386_INVOP,subcode=0x0) 错误
- ubuntu 应用程序菜单_Ubuntu智能手机,塔式无人机飞行控制应用程序等
- 微信公众号自动回复html,[.NET] 简单接入微信公众号开发:实现自动回复
- 载入Haskell的函数
- CAM是利用计算机,利用DroidCam将手机摄像头打造成计算机摄像头
- 完善计算机 实践性教学,计算机基础实践性教学分析论文.doc
- 401 Unauthorized: ERROR Failed to connect to newly launched supervisor. Agen
- No bootable device
- 2019最值得关注的科技趋势【附罗振宇跨年演讲视频】
- 第十三届蓝桥杯大赛软件赛省赛 Python 大学 B 组
- Thinkphp内核开发盲盒商城源码v2.0 对接易支付/阿里云短信/七牛云存储
- STM32单片机的PSAM卡驱动模块设计
- 论文阅读笔记---《TransferNet: An Effective and Transparent Framework for Multi-hop Question Answering over》
- 影像组学工作站 | 医学影像组学高分SCI教你躺平,零基础,零代码完整复现!
- PAT甲级 A1042