Issue
I am running the container hypriot/rpi-busybox-httpd
I am trying to ssh to docker container, but it is giving this error:
pi@raspberrypi:~ $ docker exec -it cc55da85b915 bash
rpc error: code = 2 desc = oci runtime error: exec failed: container_linux.go:247: starting container process caused "exec: \"bash\": executable file not found in $PATH"
pi@raspberrypi:~ $ docker exec -it cc55da85b915 sh
rpc error: code = 2 desc = oci runtime error: exec failed: container_linux.go:247: starting container process caused "exec: \"sh\": executable file not found in $PATH"
Am I doing it the right way?
Solution
It could be your image does not have the binary /bin/bash installed (as suggested before), I had the same problem and I was able to enter into the container using /bin/sh
docker exec -ti cc55da85b915 /bin/sh
Another workaround could be execute directly the commands without get access to any shell.
docker exec -ti cc55da85b915 ls /etc
Answered By - Esteban Collado Answer Checked By - Dawn Plyler (WPSolving Volunteer)