Docker Community Forums

Share and learn in the Docker community.

Docker not working due to proxy issue


(Saravanakumard) #1

I have installed the docker in ubuntu 16.

Have added the proxy in the ubuntu and working fine. getting below error after running docker commands

docker pull ubuntu
Using default tag: latest
Error response from daemon: Get https://registry-1.docker.io/v2/: net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers

As i did online research and added proxy details in the docker configuration files

Step 1

cat /etc/default/docker

Docker Upstart and SysVinit configuration file

THIS FILE DOES NOT APPLY TO SYSTEMD

Please see the documentation for “systemd drop-ins”:

https://docs.docker.com/engine/articles/systemd/

If you need Docker to use an HTTP proxy, it can also be specified here.

export http_proxy= xx:xx
export https_proxy=xx:xx

Then restart docker:

Step 2

(1) Create a systemd drop-in directory:

mkdir /etc/systemd/system/docker.service.d
(2) Add proxy in /etc/systemd/system/docker.service.d/http-proxy.conf file:

cat /etc/systemd/system/docker.service.d/http-proxy.conf

[Service]
Environment="HTTP_PROXY=xx:xx
Environment="HTTPS_PROXY=xx:xx
Environment=“NO_PROXY=localhost,127.0.0.1,localaddress,.localdomain.com”
(3) Flush changes:

systemctl daemon-reload
(4) Restart Docker:

but still not working

systemctl restart docker


(Saravanakumard) #2

:roll_eyes: please do help… i was totally fed up


(Aminul) #3

Hi,
Perhaps you resolved the proxy issue. However, I would like to point out for others that the poster followed all steps correctly except missed closing double quotation mark while setting proxy address in steps 2.

Thanks,
Aminul


(Vasupandian) #4

Wow Kool it worked for me