12726/my-docker-container-has-no-internet
Try resetting all the parameters
pkill docker iptables -t nat -F ifconfig docker0 down brctl delbr docker0 docker -d
It will force docker to recreate the bridge and reinit all the network rules
The most common reason for this error is if the container holds an invalid DNS. Then the container will not be able to resolve the domain name into IP addresses. And hence the ping google.com will also fail. Run the following command to check for DNS server:
cat /etc/resolv.conf
Restarting Docker worked for me. Restart it using the following command:
service docker restart
If you're running Docker on OSX, do the following:
docker-machine restart <...wait for it to restart, which takes up to a minute...> docker-machine env eval $(docker-machine env)
For me, it was the host's firewall. I had to allow DNS on the host's firewall. And also had to restart docker after changing the host firewall setting.
When you start a docker container, you ...READ MORE
No, you won’t lose any data when ...READ MORE
Hi@akhtar, To expose you container from outside you ...READ MORE
Hi@akhtar, Yes, whatever you stored inside docker container ...READ MORE
When you use docker-compose down, all the ...READ MORE
Hey @nmentityvibes, you seem to be using ...READ MORE
It can work if you try to put ...READ MORE
To solve this problem, I followed advice ...READ MORE
Adding to kalgi's answer, You can also ...READ MORE
you can run any command in a ...READ MORE
OR
At least 1 upper-case and 1 lower-case letter
Minimum 8 characters and Maximum 50 characters
Already have an account? Sign in.