簡體   English   中英

將Docker映像拉到公司防火牆后面會引發“服務器錯誤:獲取映像層時狀態為0”

[英]Pull docker image behind a corporate firewall throws “Server error: Status 0 while fetching image layer”

我無法在公司防火牆后面下載圖像。

這篇文章幫助我修復了與主機名錯誤相關no地址 我使用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)

知道為什么拉請求失敗了嗎? 拉取請求是否使用其他端口和/或協議? 我的配置文件中缺少什么嗎?

在過去的幾天里,我發現服務器錯誤:獲取圖像層時出現狀態0是任何類型的網絡問題的通用錯誤消息。 它可能指向錯誤的DNS服務器或缺少SSL證書。

我通過使用最新的SSL更新所有SSL證書並重新啟動docker來解決它。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM