Unable to download Docker images behind a proxy

Let’s have a glance at troubleshooting dockers issues.

As a part of our server management services, we use to handle several such Docker-related issues. You can also consult our technical team support for further assistance.

 Fixing the error.

One of our client reports where he tries to run the below command to install Docker on the ubuntu server.

sudo docker pull busybox

The following error was displayed on the screen

Pulling repository busybox
2021/03/16 09:37:07 Get https://index.docker.io/v1/repositories/busybox/images: dial tcp: lookup index.docker.io on 127.0.1.1:53: no answer from server

How to resolve the error

In order to resolve this problem, we first create a systemd drop-in directory for the Docker service and then execute the command.

mkdir /etc/systemd/system/docker.service.d

Later, create a file called /etc/systemd/system/docker.service.d/http-proxy.conf that adds the HTTP_PROXY environment variable:

[Service]

Environment=”HTTP_PROXY=http://proxy.example.com:80/”

Note: In case, if you have internal Docker registries then contact without proxying you can specify them via the NO_PROXY environment variable:

Environment=”HTTP_PROXY=http://proxy.example.com:80/”

Environment=”NO_PROXY=localhost,127.0.0.0/8,docker-registry.somecorporation.com”

Executive the commands to flush the changes.

$ sudo systemctl daemon-reload

Run the command to verify whether the configuration is loaded or not.

$ sudo systemctl show --property Environment docker

Environment=HTTP_PROXY=http://proxy.example.com:80/

Run the following command in order to restart the docker

$ sudo systemctl restart docker

This will fix the error.

Conclusion

In short, follow the methods to resolve the docker errors. Need further assistance to fix any sort of error, get in touch with us with 24/7 technical support.

More Posts

Amazon IVS

The Amazon Interactive Video Service (Amazon IVS) is a brand-new tool for creating live interactive video experiences. By simply pointing your live stream to Amazon

How to fix Cloudflare 502 error

Usually, the error used to occur when Cloudflare doesn’t have contact with an origin web server. As a part of our server management services, we use

Send Us A Message

Having issues with your website/server

Get our experts to audit your server for FREE!!