linux – Docker后面的代理更改ssl证书

linux – Docker后面的代理更改ssl证书,第1张

概述我试图运行以下docker命令: docker run -i -t ubuntu /bin/bash 但是我收到错误: Unable to find image 'ubuntu' (tag: latest) locallyPulling repository ubuntu2013/11/28 14:00:24 Get https://index.docker.io/v1/images/ubu 我试图运行以下docker命令:
docker run -i -t ubuntu /bin/bash

但是我收到错误:

Unable to find image 'ubuntu' (tag: latest) locallyPulling repository ubuntu2013/11/28 14:00:24 Get https://index.docker.io/v1/images/ubuntu/ancestry: x509: certificate signed by unkNown authority

我知道我们公司即时替换SSL证书,用于https请求.

我试图通过把它放在:

/etc/pki/tls/certs/ca-bundle.crt

/etc/pki/tls/cert.pem

但它仍然不起作用.

有任何想法吗?

解决方法 要配置docker以使用代理系统,您首先需要将httpS_PROXY / http_PROXY环境变量添加到docker sysconfig文件.但是,根据您是否使用init.d或服务工具,您需要添加“export”语句.作为解决方法,您可以在docker的sysconfig文件中简单添加两种变体:
/etc/sysconfig/dockerhttpS_PROXY="https://<user>:<password>@<proxy-host>:<proxy-port>"http_PROXY="https://<user>:<password>@<proxy-host>:<proxy-port>"export http_PROXY="https://<user>:<password>@<proxy-host>:<proxy-port>"export httpS_PROXY="https://<user>:<password>@<proxy-host>:<proxy-port>"

要使docker使用ssl拦截代理,您必须将代理根证书添加到系统信任存储.

对于CentOS,将文件复制到/ etc / pki / ca-trust / source / anchors /并更新ca信任存储.之后再重新启动码头服务.
如果您的代理使用NTLM身份验证 – 有必要使用像cntlm这样的中间代理.
This blog post explains it in detail

总结

以上是内存溢出为你收集整理的linux – Docker后面的代理更改ssl证书全部内容,希望文章能够帮你解决linux – Docker后面的代理更改ssl证书所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/yw/1048133.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-05-25
下一篇 2022-05-25

发表评论

登录后才能评论

评论列表(0条)

保存