Languages
[Edit]
EN

Fix for docker error - OCI runtime exec failed: exec failed: container_linux.go:349: starting container process caused "exec: \"/bin/bash\": stat /bin/bash: no such file or directory": unknown

7 points
Created by:
Kate_C
19580

Hi, today I would like to share with you solution to a problem I've encountered when I tried to login to docker container.

My error:

[root@localhost]# docker exec -ti auth-service /bin/bash
OCI runtime exec failed: exec failed: container_linux.go:349: starting container process caused "exec: \"/bin/bash\": stat /bin/bash: no such file or directory": unknown

Solution

Solution is quite simple.

The docker container didn't have /bin/bash installed, so I used /bin/sh instead and it solved my problem. 

Example of correct login to docker container using /bin/sh:

$ docker exec -ti auth-service /bin/sh

Practical example from CMD:

[root@localhost]# docker exec -ti auth-service /bin/sh
/ # ls -al
total 43548
drwxr-xr-x    1 root     root            46 Oct  1 18:09 .
drwxr-xr-x    1 root     root            46 Oct  1 18:09 ..
-rwxr-xr-x    1 root     root             0 Oct  1 18:09 .dockerenv
drwxr-xr-x    2 root     root          4096 May  9  2019 bin

 

Native Advertising
50 000 ad impressions - 449$
🚀
Get your tech brand or product in front of software developers.
For more information contact us:
Red dot
Dirask - friendly IT community for everyone.

❤️💻 🙂

Join