从Docker拉取镜像时出现EOF错误

4
我收到以下错误:
在执行命令 "docker pull openjdk" 时发生错误。
Using default tag: latest

Pulling repository docker.io/library/openjdk

Error while pulling image: Get https://index.docker.io/v1/repositories/library/openjdk/images: EOF

我在 /etc/systemd/system/docker.service.d/http-proxy.conf 和 /etc/systemd/system/docker.service.d/https-proxy.conf 中设置了 HTTP_PROXY 和 HTTPS_PROXY。但我仍然无法从 Docker Hub 中拉取任何镜像。
以下是 Docker 版本输出:
客户端: 版本:1.12.6 API 版本:1.24 Go 版本:go1.6.4 Git 提交记录:78d1802 构建日期:2017年1月10日周二 20:20:01 操作系统/架构:linux/amd64
服务器: 版本:1.12.6 API 版本:1.24 Go 版本:go1.6.4 Git 提交记录:78d1802 构建日期:2017年1月10日周二 20:20:01 操作系统/架构:linux/amd64

你在代理字符串中设置了用户名/密码吗? - VonC
是的!https://<用户名>:<密码>@<IP>:<端口> - Ashish Prabhune
您的密码是否包含任何需要百分号编码的特殊字符?(https://en.wikipedia.org/wiki/Percent-encoding#Character_data) - VonC
是的,密码包含一个 $ 符号,使用 %24 进行百分号编码。 - Ashish Prabhune
在 http_proxy 中,IP 的值应该是什么?是虚拟机 IP 还是其他什么。由于我的用户名和密码是正确的,唯一怀疑的是 IP 问题。 - Ashish Prabhune
您可以使用IP地址(以避免任何DNS名称解析问题)。但请确保您的代理URL以http://开头。即使是https_proxy也不要使用https。 - VonC
1个回答

1
这是我的设置:
etc/systemd/system/docker.service.d
more http-proxy.conf
[Service]
Environment="HTTP_PROXY=http://user:password@proxy.mycompany.com:8080/" "HTTPS_PROXY=http://user:password@proxy.mycompany.com:8080/"  "NO_PROXY=localhost,127.0.0.1,.mycompany.com"

请注意,HTTP_PROXYHTTPS_PROXY 都使用代理的 http URL。并确保(使用 NO_PROXY)任何内部 URL 不使用代理。

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接