Cannot download Docker images behind a proxy

0 votes

I have ubuntu 13.10, when I try to pull an image using the following command

sudo docker pull busybox

I’m getting an error

Pulling repository busybox
2014/04/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

I installed docker on my ubuntu 13.10 and when I type in my console:

Docker version:

$ sudo docker version

Client version: 0.10.0
Client API version: 1.10
Go version (client): go1.2.1
Git commit (client): dc9c28f
Server version: 0.10.0
Server API version: 1.10
Git commit (server): dc9c28f
Go version (server): go1.2.1
Last stable version: 0.10.0

I’m behind a proxy server without any authentication.

Acquire::http::proxy "http://192.168.1.1:3128/";
Acquire::https::proxy "https://192.168.1.1:3128/";
Acquire::ftp::proxy "ftp://192.168.1.1:3128/";
Acquire::socks::proxy "socks://192.168.1.1:3128/";

Where m I going wrong?

Jul 27, 2018 in Docker by Hannah
• 18,520 points
2,543 views

1 answer to this question.

0 votes

Follow these steps

Step 1- create a systemd drop-in directory for the docker service:

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

step 2 – create a file called /etc/systemd/system/docker.service.d/http-proxy.conf and add the HTTP_PROXY env variable.

[Service]
Environment="HTTP_PROXY=http://proxy.example.com:80/"

Step 3 – If you have internal Docker registries that you need to 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"

Step 4 - Flush changes:

$ sudo systemctl daemon-reload

Step 5- Verify that the configuration has been loaded:

$ sudo systemctl show --property Environment docker
Environment=HTTP_PROXY=http://proxy.example.com:80/

Step 6- Restart Docker:

$ sudo systemctl restart docker
answered Jul 27, 2018 by Kalgi
• 52,350 points

Related Questions In Docker

0 votes
2 answers
+1 vote
2 answers
0 votes
1 answer

Delete multiple docker images at a time.

Hi@akhtar, You can create your customize command to ...READ MORE

answered Jul 6, 2020 in Docker by MD
• 95,460 points
810 views
+2 votes
1 answer
+2 votes
1 answer

Deploy Docker Containers from Docker Cloud

To solve this problem, I followed advice ...READ MORE

answered Sep 3, 2018 in AWS by Priyaj
• 58,020 points
2,715 views
0 votes
1 answer

How to create a container and run images in docker?

Look for what all images you have ...READ MORE

answered Feb 23, 2019 in Docker by Kalgi
• 52,350 points
2,220 views
+4 votes
4 answers

How To Access a Service on Host From a Docker Container?

Adding to kalgi's answer, You can also ...READ MORE

answered Oct 16, 2018 in Docker by lina
• 8,220 points

edited Oct 16, 2018 by lina 34,135 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP