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
• 14,090 points
64 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
• 39,150 points

Related Questions In Docker

0 votes
2 answers
0 votes
2 answers
0 votes
1 answer

How to run a docker command from inside the container?

You must have come across the /var/run/docker.sock file, ...READ MORE

answered Jun 28, 2018 in Docker by Sophie may
• 9,530 points
300 views
0 votes
1 answer
0 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
• 56,200 points
128 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 22 in Docker by Kalgi
• 39,150 points
80 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,100 points

edited Oct 16, 2018 by lina 3,712 views