Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

/bin/bash gives me the error inside docker container

i have been trying to cope with sh, but there have been multiple problems being arose. I need /bin/bash inside Docker Container. But when i run this command it gives me the 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. i think i need to get bin/bash inside the container. But dont know how?

Terminal Command: sudo docker exec -it 35f4fb7c0b0d /bin/bash

Terminal Output: 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

Thanks in Advance.

like image 496
Çh Furqan Hämëèd Jūtt Avatar asked Sep 14 '26 04:09

Çh Furqan Hämëèd Jūtt


1 Answers

If your image is using an alpine version then it comes pre-loaded with the "sh" which is "light weight Bourne shell" similar to "bash", you don't need to install the bash again you can simply use the "sh" instead of "bash".

sudo docker exec -it 35f4fb7c0b0d sh
like image 177
Thakur Amit Avatar answered Sep 16 '26 21:09

Thakur Amit



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!