Unable to ping from one container to another container connected in the same network

202 Views Asked by At

I created two containers and connected them to a same network. But when I use the commands:

docker exec -ti docker-client1 sh 
ping -c 2 docker-client2 

I get the error:

"sh: 1: ping: not found"

I have used the container names instead of IP address, as both are connected to the same network.

1

There are 1 best solutions below

1
On BEST ANSWER

The ping program is not available in your image. Check what OS your image is based on, then research how to install packages on that OS and what package the ping program is contained in.