![](/img/trans.png)
[英]Docker on Windows (Boot2Docker) - certificate signed by unknown authority error
[英]How to ignore certificate errors in Boot2Docker on windows
我通过virtualbox在windows上运行boot2docker 1.4.1。 我支持MITM https证书的代理。 我通过在/var/lib/boot2docker/profile
添加以下行来配置代理:
export HTTP_PROXY=<proxyhost>:80
export HTTPS_PROXY=<proxyhost>:80
DOCKER_TLS=no
EXTRA_ARGS="--insecure-registry index.docker.io"
但是当我运行docker@boot2docker:~$ docker run hello-world
我得到了
Unable to find image 'hello-world:latest' locally
Pulling repository hello-world
FATA[0006] Get https://index.docker.io/v1/repositories/library/hello-world/images
: x509: certificate signed by unknown authority
请帮我弄清楚忽略证书错误的正确方法。 谢谢!
编辑看起来新的docker仅适用于某些版本的Windows 10 。 如果您仍然停留在Windows 7上,我已经更新了以下内容,以反映我在安装最新版本的docker-toolbox( Docker 1.11.2)时纠正“证书链中的自签名证书”错误所需的步骤)。
最后,在Windows 7上按照以下答案进行操作: https : //github.com/boot2docker/boot2docker/issues/347
通过运行openssl s_client -showcerts来检查这是您的问题:
docker@boot2docker:~$ openssl s_client -showcerts -CApath . -connect index.docker.io:443
(编辑:从-showcerts删除了32并更正了主机名)
在证书链中,您将看到代理已插入自身,并且验证返回类似这样的错误
Verify return code: 19 (self signed certificate in certificate chain)
如果您遇到同样的问题,请尝试以下步骤:
docker@boot2docker:~$ sudo mkdir /var/lib/boot2docker/certs/
docker@boot2docker:~$ sudo cp /c/Users/<username>/<folder>/<proxy-cert>.pem /var/lib/boot2docker/certs/
/var/lib/boot2docker/bootlocal.sh
并包含来自https://gist.github.com/irgeek/afb2e05775fff532f960的源代码(我刚刚使用Notepad ++在Windows中创建了该文件并将其复制到类似于上一步) C:\\>docker-machine restart
docker-machine ssh
并验证更改是否有效: docker run hello-world
您应该看到包含以下内容的输出:
Hello from Docker.
This message shows that your installation appears to be working correctly.
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.