There is no option to provide the net as param while building the docker images.
So the container doesn’t have internet from inside.
and is common to get this kind of errors
Running in NNNNNNNNN Err http://http.debian.net wheezy Release.gpg Could not resolve 'http.debian.net'
One (stupid) solution is to put in the Docker file
RUN echo "nameserver 126.96.36.199" > /etc/resolv.conf; cat /etc/resolv.conf
Another is to help Docker with the networking.
Here is a solution is pointed here
# Forward chain between docker0 and eth0 iptables -A FORWARD -i docker0 -o eth0 -j ACCEPT iptables -A FORWARD -i eth0 -o docker0 -j ACCEPT
# IPv6 chain if needed ip6tables -A FORWARD -i docker0 -o eth0 -j ACCEPT ip6tables -A FORWARD -i eth0 -o docker0 -j ACCEPT
And also to configure docker to use a dns server as pointed here
Open the /etc/default/docker file for editing.
$ sudo nano /etc/default/docker
Add a setting for Docker.
Replace 188.8.131.52 with a local DNS server such as 192.168.1.1. You can also specify multiple DNS servers. Separated them with spaces, for example:
–dns 184.108.40.206 –dns 192.168.1.1
Warning: If you’re doing this on a laptop which connects to various networks, make sure to choose a public DNS server.
ps: nm-tool can be used to check local host DNS server
Save and close the file.
Restart the Docker daemon.
$ sudo restart docker