I have these two containers on the same network
docker inspect my_app_net [ { "Name": "my_app_net", "Id": "e136b758e8009e0361168aa0ead14ec85973c8d4f93e65122c22a2ff18f5e61f", "Created": "2018-03-22T21:11:51.781623693+01:00", "Scope": "local", "Driver": "bridge", "EnableIPv6": false, "IPAM": { "Driver": "default", "Options": {}, "Config": [ { "Subnet": "172.19.0.0/16", "Gateway": "172.19.0.1" } ] }, "Internal": false, "Attachable": false, "Ingress": false, "ConfigFrom": { "Network": "" }, "ConfigOnly": false, "Containers": { "a966584cd491caff18b25fa347b738a0853e5195ac517b5fb26bb019a271fc10": { "Name": "new_pizd", "EndpointID": "fdbacbbd564aeacccc57367dd082232e0498976ca485597b6ba8f6c82a0d4240", "MacAddress": "02:42:ac:13:00:03", "IPv4Address": "172.19.0.3/16", "IPv6Address": "" }, "b36f350efca1f2e79bef8027a32f992021091fdd701e4d55d98af78984072150": { "Name": "new_nginx2", "EndpointID": "38731d2618aba0a7c63debd3b30a4c9b530d83a4fddbda97cdd2498298007120", "MacAddress": "02:42:ac:13:00:02", "IPv4Address": "172.19.0.2/16", "IPv6Address": "" } }, "Options": {}, "Labels": {} } ] When I try to ping the second from the first
docker container exec -it new_pizd ping new_nginx2 OCI runtime exec failed: exec failed: container_linux.go:348: starting container process caused "exec: \"ping\": executable file not found in $PATH": unknown This is quite strange. How can I check the docker variable $PATH? Which executable file does it refer to? EDIT
Suggested answer asks for echo PATH,but it is the same as from my Ubuntu shell
docker exec -ti new_nginx2 echo $PATH /home/milenko/eclipse:/home/milenko/miniconda3/bin:/home/milenko/bin:/home/milenko/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin And
milenko@milenko-System-Product-Name:~$ docker exec -ti new_nginx2 bash root@b36f350efca1:/# echo $PATH /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin I have checked the bin,there is no ping inside
root@b36f350efca1:/bin# ls ping* ls: cannot access 'ping*': No such file or directory