2016-01-18 90 views
2

我需要設置公司代理,以便Docker可以從公共註冊表下載圖片。Docker:設置代理下載圖片

$ sudo docker run hello-world 
Unable to find image 'hello-world:latest' locally 
Pulling repository docker.io/library/hello-world 
Error while pulling image: Get https://index.docker.io/v1/repositories/library/hello-world/images: dial tcp: lookup index.docker.io: no such host 

我使用的是Ubuntu 12.04機器。我發現this answer,但在Ubuntu 12.04中不存在systemctl。我怎樣才能做到這一點?

謝謝。

+1

谷歌結果#4「泊塢窗設置代理」:http://nknu.net/running-docker-behind-a-proxy-on-Ubuntu-14-04/ –

+0

謝謝。它的工作原理。將它發佈爲答案,我將接受 –

+0

[無法在代理後面下載Docker鏡像](https:/ /stackoverflow.com/questions/23111631/cannot-download-docker-images-behind-a-proxy) –

回答

0

編輯/etc/defaults/docker.io並添加以下行:

export http_proxy='http://user:[email protected]:proxy-port' 

然後重啓碼頭工人守護進程:

sudo service docker.io restart 

Source

2

我收到以下錯誤試圖運行Hello世界貨櫃

$docker run hello-world 
Unable to find image 'hello-world:latest' locally 
docker: Error response from daemon: Get https://registry-1.docker.io/v2/: dial tcp 34.205.194.204:443: getsockopt: no route to host. 

我想在下面的鏈接,工作對我來說相對於HTTPS或HTTP配置

https://docs.docker.com/engine/admin/systemd/#httphttps-proxy

1

在CentOS,什麼對我的作品是這行添加到/etc/sysconfig/docker步驟:

http_proxy=your_proxy:port 
0

解決方案:

[根@ XX〜]#搬運工拉你好世界 使用默認標籤:最新 拉庫docker.io/library/hello-world 錯誤而拉圖像:獲取https://index.docker.io/v1/repositories/library/hello-world/images:authenticationrequired文件/etc/systemd/system/docker.service.d/https

早些時候,我已經設置泊塢窗代理-proxy.conf

/* [服務] 環境= 「HTTPS_PROXY = http://xxx:8080/」 */

然後我評論此,和sys重載 #sudo systemctl守護程序重裝 #sudo systemctl restart docker

然後我試着拉你好,我知道了。 或 嘗試用正確的用戶名,PSWD,代理地址...

泊塢窗的某個時候與代理還沒有工作:(代理