Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

OCI runtime exec failed: exec failed: container_linux.go:344: starting container process

When i run the below command

$ docker container exec -it nginx1 ping nginx2 

This is the error which i faced :

OCI runtime exec failed: exec failed: container_linux.go:344: starting container process caused "exec: \"ping\": executable file not found in $PATH": unknown

How to resolve this issue ?

like image 510
Jakka rohith Avatar asked Mar 27 '19 13:03

Jakka rohith


2 Answers

Before reading this answer just let you know, it's my 2nd day of learning docker, It may not be the perfect help for you.

This error may also occur when the ping package is not installed in the container, I resolved the problem as follow, bash into the container like this

docker container exec -it my_nginx /bin/bash

then install ping package

apt-get update
apt-get install inetutils-ping

This solved my problem.

like image 174
vaibhav mehta Avatar answered Oct 08 '22 03:10

vaibhav mehta


Please use alpine image of nginx:

docker container run -d --name my_nginx_name nginx:alpine

docker container run -d --name my_nginx_name2 nginx:alpine

Then try to ping using below command:

docker container exec -it my_nginx_name ping my_nginx_name2

like image 21
Ankitsrivasta Avatar answered Oct 08 '22 03:10

Ankitsrivasta