Docker – exec: "bash": executable file not found in $PATH

If bash shell is not working, try sh.

Terminal

$ docker ps

CONTAINER ID        IMAGE               COMMAND               CREATED             STATUS              PORTS                  NAMES
3d1588519433        markdownhtml:0.1    "java -jar app.jar"   About an hour ago   Up About an hour    0.0.0.0:80->8080/tcp   gracious_haibt

$ docker exec -it 3d1588519433 bash

OCI runtime exec failed: exec failed: container_linux.go:349:
starting container process caused "exec: \"bash\": executable file not found in $PATH": unknown

The truth is, not every image is using the bash shell; try sh shell.

Terminal

$ docker exec -it 3d1588519433 sh

/home/hello #

References

15 comments on “Docker – exec: "bash": executable file not found in $PATH

  1. Geeeeeeeeeeeeeeeeeeez thanks man. Exactly what I needed. I’m so used to running a ubuntu image I forgot this time I’m running an alpine. *face slap*

Leave a Comment

Your email address will not be published. Required fields are marked *