12
e44671200b7c /# mysql -u root -p bash 

mysql: command not found

I was able to enter into the container "mariadb" using

docker exec -it e44671200b7c /bin/bash

but i couldn't and i have this now error

OCI runtime exec failed: exec failed: container_linux.go:349: starting container process caused "exec: \"bash\": executable file not found in $PATH": unknown
Klesun
  • 12,280
  • 5
  • 59
  • 52
Zeineb Khairallah
  • 139
  • 1
  • 1
  • 5
  • 1
    Hey! Please try to improve your question. I have read it several times, but I still don't get what did you mean to ask here. Probably you will find this guide useful: https://stackoverflow.com/help/how-to-ask – zinovyev Sep 17 '20 at 20:33
  • Also be sure you don't do something like `docker ... -v /my/binaries:/bin`. – Drakes Nov 25 '20 at 04:00

2 Answers2

29

bash is not present in mariadb Docker image. Use docker exec -it e44671200b7c /bin/sh or simply docker exec -it e44671200b7c sh instead.

Pierre B.
  • 11,612
  • 1
  • 37
  • 58
  • i tried too but i want to get into the container i was able to get into the container but when i trie to fix that " mysql: command not found " – Zeineb Khairallah Sep 17 '20 at 11:50
  • Similar issue, that's because `mariadb` does not have `mysql` binaries installed. See https://stackoverflow.com/questions/39901311/docker-ubuntu-bash-ping-command-not-found. You seem new to Docker, maybe you should try to understand how a Docker image works and how to install/use packages in a Docker image, here's a good start: https://docs.docker.com/get-started/ – Pierre B. Sep 17 '20 at 13:37
0

There are few images which do not support the interactive shell/bash. Example - Docker image mockserver/mockserver Docker Set Up

Docker Setup Page for MockServer

Ravi Wadje
  • 1,145
  • 1
  • 10
  • 15