Docker failed to fetch http://deb.debian.org/debian/dists/jessie/InRelease [closed]
I just dealt with this issue building the cartoza/postgis image, that stems from debian:stable
. This happens because some popular public DNS are not reachable from this network, e.g.:
$ nslookup duckduckgo.com 8.8.8.8;; connection timed out; no servers could be reached
Possibly the simplest way around this is to directly instruct Docker to use the DNS available to the network. Start by verifying their addresses:
$ nmcli dev show | grep 'IP4.DNS'IP4.DNS[1]: 10.91.3.31IP4.DNS[2]: 10.90.3.31IP4.DNS[3]: 10.90.7.14
Add them to a new configuration file called daemon.json
:
$ sudo pico /etc/docker/daemon.json
And insert the following:
{ "dns": ["10.91.3.31", "10.90.3.31", "10.90.7.14"]}
Then restart the service:
$ sudo service docker restart
The /etc/default/docker file is only used on systems using "upstart" and "SysVInit", not on systems using systemd.
This is also mentioned at the top of the file:https://github.com/docker/docker/blob/44fe8cbbd174b5d85d4a063ed270f6b9d2279b70/contrib/init/sysvinit-debian/docker.default#L1
So, don't use /etc/default/docker. It's used only by upstart, which is not used by Ubuntu since 16.04.
Use /etc/docker/daemon.json, which is documented here: https://docs.docker.com/engine/reference/commandline/dockerd/#/linux-configuration-file
There you can configure your dns
One reason could be that your proxy is not set in Docker file, add these 2 lines in Dockerfile:
ENV http_proxy "http://www-proxy.x.com:80"ENV https_proxy "http://www-proxy.x.com:80"
Please, update your proxy there.And don't write
ENV HTTP_PROXY "http://www-proxy.x.com:80"
because the env variable is the case sensitive