I installed Docker on my Ubuntu 13.10 (Saucy Salamander) and when I type in my console:
sudo docker pull busybox
I get the following 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
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 am behind a proxy server with no authentication, and this is my /etc/apt/apt.conf
file:
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/";
What am I doing wrong?
Your APT proxy settings are not related to Docker.
Docker uses the HTTP_PROXY environment variable if present, for example:
But instead, I suggest you have a look at your
/etc/default/docker
configuration file : you should have a line to uncomment (and maybe adjust) to get your proxy settings applied automatically. Then restart the Docker server:To extend Arun's answer above, for this to work in CentOS 7, I had to remove the "export" commands. So edit
And add:
Then restart Docker:
The source is this blog post.
After installing Docker, do the following:
Then, you can pull or do anything:
Here is a link to the official Docker documentation for proxy HTTP: https://docs.docker.com/config/daemon/systemd/#httphttps-proxy
A quick outline:
First, create a systemd drop-in directory for the Docker service:
Now create a file called
/etc/systemd/system/docker.service.d/http-proxy.conf
that adds theHTTP_PROXY
environment variable:If you have internal Docker registries that you need to contact without proxying you can specify them via the
NO_PROXY
environment variable:Flush changes:
Verify that the configuration has been loaded:
Restart Docker:
Perhaps you need to set up lowercase variables. In my case, my /etc/systemd/system/docker.service.d/http-proxy.conf file is look like this:
Good luck! :)
If using socks5 proxy, here is my test with Docker 17.03.1-ce with setting "all_proxy", and it worked: