Hi, today I would like to share with you solution to a problem I've encountered when I tried to login to docker container.
[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 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