Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Ping Command inside docker container doesnt work

I can ping an IP from host box (Linux centos rhel 7.2) but when I do the same inside docker container, it fails to respond.

[root@f321ef079128]# ping 10.254.19.46 PING 10.254.19.46 (10.254.19.46) 56(84) bytes of data.

What can be the issue?

Thanks

like image 687
Umapathy Avatar asked Oct 31 '16 10:10

Umapathy


People also ask

How do I run a command inside a container?

In order to run a command inside a Docker Container using the exec command, you have to know the Container Id of the Docker Container. You can get the Container Id using the following Command. Once you have the Container ID, you can use the Docker exec command.


1 Answers

This might help:

My docker container has no internet

Top suggestions seems to be to restart the docker service:

service docker restart
like image 133
mattjtyas Avatar answered Sep 17 '22 18:09

mattjtyas