I had it working allright but now it stopped. I tried the following commands with no avail:
docker run -dns 8.8.8.8 base ping google.com
docker run base ping google.com
sysctl -w net.ipv4.ip_forward=1
- both on the host and on the container
All I get is unknown host google.com
. Docker version 0.7.0
Any ideas?
P.S. ufw
disabled as well
The intended way to restart docker is not to do it manually but use the
service
or init command:I had the problem on Ubuntu 18.04. However the problem was with the DNS. I was in a corporate network that has its own DNS server and block other DNS servers. This is to block some websites (porn, torrents, ... so on )
To resolve your problem
use --dns your_dns as suggested by @jobin
docker run --dns your_dns -it --name cowsay --hostname cowsay debian bash