Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Docker build error OCI runtime create failed "exec: \"/bin/bash\": stat /bin/bash

Getting following error while run docker build...

OCI runtime create failed: container_linux.go:349: starting container process caused "exec: \"/bin/bash\": stat /bin/bash: no such file or directory": unknown
like image 552
Thế Huynh Phạm Avatar asked Apr 22 '20 05:04

Thế Huynh Phạm


2 Answers

Your container doesn't have bash installed but probably it has sh so run the container with (replace /bin/bash with /bin/sh):

docker exec -it username/imagename /bin/sh
like image 136
Xaqron Avatar answered Oct 21 '22 00:10

Xaqron


This is because the container i'm trying to access doesn't have the /bin/bash executable.

Replace RUN ["/bin/bash"... by RUN ["/bin/sh"...

like image 38
Thế Huynh Phạm Avatar answered Oct 21 '22 00:10

Thế Huynh Phạm