Getting connection refused in docker
I got the solution for this.
1.Create a systemd drop-in directory for the docker service:
$ sudo mkdir -p /etc/systemd/system/docker.service.d
2.Create a file called /etc/systemd/system/docker.service.d/http-proxy.conf that adds the HTTP_PROXY environment variable: (Use sudo touch/nano to create file)
sudo nano filename.txt
[Service]
Environment="HTTP_PROXY=http://proxy.example.com:80/"
3.Flush changes:
$ sudo systemctl daemon-reload
4.Restart Docker:
$ sudo systemctl restart docker
5.Verify that the configuration has been loaded:
$ systemctl show --property=Environment docker Environment=HTTP_PROXY=http://proxy.example.com:80/
visit : https://docs.docker.com/config/daemon/systemd/#httphttps-proxy
Related videos on Youtube
R Kumar
Updated on September 18, 2022Comments
-
R Kumar over 1 year
I am using ubuntu 16.04. After installing
docker
, when I rundocker pull hello-world
, I am getting this error :Using default tag: latest Error response from daemon: Get https://registry-1.docker.io/v2/: dial tcp 35.169.231.249:443: getsockopt: connection refused
I think the problem may be due to the proxy setting of my connection. I am using college LAN and it uses proxy setting for hostname and port. I am getting problem only here in
docker
. Rest of the thing is working properly in connectivity. Please help, what to do?-
jhilmer almost 6 yearsPerhaps this can help you blog.codeship.com/using-docker-behind-a-proxy
-