0

I have this Linux box

$ uname -a
Linux TOCWgfi7IC 2.6.32-504.el6.x86_64 #1 SMP Tue Sep 16 01:56:35 EDT 2014 x86_64 x86_64 x86_64 GNU/Linux

I have docker running on it (someone else installed it for me, but it seems the configuration files like /etc/default/docker don't exist)

I use a proxy http and https.
I've added the proxy settings to .bashrc file and .bash_profile and I was able to pull with github. I've also added HTTP_PROXY and the lowercase version (http_proxy) to /etc/default/docker, /etc/environment, /etc/apt/apt.conf, /etc/bash.bashrc and probably others too)

My proxies are in this format:

http_proxy=http://proxyprd.sss.com:8080
https_proxy=https://proxyprd.sss.com:8080

If I use wget I can't get anything. Requests time out.

sudo wget https://index.docker.io/v1
--2015-07-07 13:13:33--  https://index.docker.io/v1
Resolving index.docker.io... 54.174.141.60, 54.210.36.116, 54.152.41.71
Connecting to index.docker.io|54.174.141.60|:443...
failed: Connection timed out.

I've looked at the docker documentation and a few SO questions and none solved the issue for me:
Problem of using proxy with wget in Ubuntu

https://docs.docker.com/articles/systemd/#http-proxy

Cannot download Docker images behind a proxy

How do I connect to the internet with docker. Do I need a username and password in the proxy line?

EDIT 1
Got wget to work by adding /root/.wgetrc and putting the proxies in there.
This didn't work for docker with /root/.dockerrc :(

Community
  • 1
  • 1
Adrian
  • 5,603
  • 8
  • 53
  • 85
  • Do you have connection to the proxy? E.g. `telnet proxyprd.sss.com 8080`. – VolenD Jul 07 '15 at 19:07
  • Not sure what you mean by connections... these are the url to the proxies: `http_proxy=http://proxyprd.sss.com:8080` and `https_proxy=https://proxyprd.sss.com:8080` – Adrian Jul 07 '15 at 19:52
  • In order to use the proxy, you must be able to connect to it. You can test this with the command `telnet proxyprd.sss.com 8080`. – VolenD Jul 07 '15 at 19:57
  • @user3584460 ya I can connect. I had issues that wget timed out but curl worked. Then I added to /root/.wgetrc the 2 proxies and it worked. I tried making a /root/.dockerrc file w the proxies but that didn't work – Adrian Jul 07 '15 at 20:34

1 Answers1

2

This has not been answered for long, but it might help others.

docker build --build-arg http_proxy=http://host:port --build-arg https_proxy=https://host:port -t dwp_service:0.1 dwp_services/

Just passing your proxy as build arguments when building the image does the trick.

Selam Getachew
  • 138
  • 2
  • 13