【问题标题】:Pull docker image behind a corporate firewall throws "Server error: Status 0 while fetching image layer"将 docker 镜像拉到公司防火墙后面会抛出“服务器错误:获取镜像层时状态 0”
【发布时间】:2016-04-08 16:41:20
【问题描述】:

我无法在公司防火墙后下载图像。

This post 帮助我修复了 no address associated with hostname 错误。我使用 Cntlm 进行代理用户身份验证。

$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 15.10
Release:    15.10
Codename:   wily

$ docker -v
Docker version 1.9.1, build a34a1d5

$ sudo docker search ubuntu
Error response from daemon: Get https://index.docker.io/v1/search?q=ubuntu: dial tcp: lookup index.docker.io: No address associated with hostname
$ sudo mv /tmp/http-proxy.conf /etc/systemd/system/docker.service.d/http-proxy.conf
$ cat /etc/systemd/system/docker.service.d/http-proxy.conf 
[Service]
Environment="HTTP_PROXY=http://localhost:3128/"

$ sudo systemctl daemon-reload
$ sudo systemctl restart docker
$ sudo docker search ubuntu | sed -e 1b -e '$!d'
NAME                              DESCRIPTION                                     STARS     OFFICIAL   AUTOMATED
esycat/ubuntu                     Ubuntu LTS                                      0                    [OK]

拉取请求与服务器交互,找到端点并失败:服务器错误:获取图像层时状态 0

$ sudo docker pull ubuntu
Using default tag: latest
latest: Pulling from library/ubuntu

fcee8bcfe180: Pulling fs layer 
4cdc0cbc1936: Pulling fs layer 
d9e545b90db8: Pulling fs layer 
c4bea91afef3: Pulling fs layer 
Pulling repository docker.io/library/ubuntu
af88597ec24b: Pulling image (latest) from docker.io/library/ubuntu, endpoint: https://registry-1.docker.iaf88597ec24b: Error pulling image (latest) from docker.io/library/ubuntu, endpoint: https://registry-1.docker.io/v1/, Server error: Status 0 while fetching image layer (895b070402bd7d26d9595e939422c598e8cc1f4adaf88597ec24b: Error pulling image (latest) from docker.io/library/ubuntu, Server error: Status 0 while fetching image layer (895b070402bd7d26d9595e939422c598e8cc1f4ade1b34e2a9659138ffe3c5c9) 

Error pulling image (latest) from docker.io/library/ubuntu, Server error: Status 0 while fetching image layer (895b070402bd7d26d9595e939422c598e8cc1f4ade1b34e2a9659138ffe3c5c9)

知道拉取请求失败的原因吗?拉取请求是否使用不同端口和/或协议?我的配置文件中有遗漏吗?

【问题讨论】:

    标签: proxy docker firewall http-proxy


    【解决方案1】:

    最近几天,我发现服务器错误:获取图像层时状态为 0 是针对任何类型的网络问题的一般错误消息。它可以指向incorrect DNS server 或缺少 SSL 证书。

    我通过updating all SSL certificates 解决了这个问题,并重新启动了最新的 docker。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2018-04-27
      • 2016-01-08
      • 2019-01-23
      • 1970-01-01
      • 2023-03-13
      • 1970-01-01
      • 1970-01-01
      • 2021-03-12
      相关资源
      最近更新 更多