Docker Community Forums

Share and learn in the Docker community.

Running docker on ubuntu behind proxy

docker

(Jlbates) #1

I am new to Docker and trying to run the tutorial hello-world. I have installed Docker on uBuntu 16.04 running as a guest on VirtualBox running on Windows 7 Pro. I am also running behind a corporate proxy. When I issue “docker run hello-world” it returns msg: “docker: Network timed out while trying to connect to https://index.docker.io/v1/repositories/library/hello-world/images. You may want to check your internet connection or if you are behind a proxy…”. I have entered the proxy settings in the /etc/default/docker file. I have the uBuntu proxy settings and am able to access the web and specifically https://index.docker.io/v1/repositories/library/hello-world/images in my browser. It shows [], just the left and right brackets, but this tells me it was able to access the Docker repository thru our proxy.

Why does the docker run fail. It’s as if it is ignoring its /etc/default/docker proxy settings. I have tried various combinations of “export http_proxy=“http://127.0.0.1:3128/”” example in the file, with our proxy address and port, of course. I have tried with/without the ‘export’, small and capitalized ‘http_proxy’ and ‘https_proxy’.

Any help is greatly appreciated.


(Todd W.) #2

when you run docker info, does it show your proxy settings in the output?
:slight_smile:


(Jerrycui) #3

I tried official method on Ubuntu 16.04, with " sudo vim /lib/systemd/system/docker.service" adding Environment=“http_proxy=127.0.0.1:1080” “https_proxy=127.0.0.1:1080”

And " sudo docker info" got :
Docker Root Dir: /var/lib/docker
Debug Mode (client): false
Debug Mode (server): false
HTTP Proxy: 127.0.0.1:1080
HTTPS Proxy: 127.0.0.1:1080

But docker still can’t go through the proxy server.( proxy server logs didn’t display any docker network info)
So is there any configuration needed to do?

BTW, I use the socks5 proxy server.