[英]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.