/bin/bash not available in container despite promoted by docs

Summary

/tec/bash in docker containers not available (only in db) other commands are not available at all but the documentation says it is there.

Steps to reproduce

I followed Redirect but neither docker exec -ti mattermost-dev /bin/bash nor telnet mail.example.com 25 works in any container.

CONTAINER ID        IMAGE                       COMMAND                  CREATED             STATUS                  PORTS                                                                  NAMES
c9b945acf6f0        mattermost-docker_web       "/entrypoint.sh"         20 hours ago        Up 20 hours (healthy)   0.0.0.0:32770->80/tcp, 0.0.0.0:40080->80/tcp, 0.0.0.0:40443->443/tcp   mattermost_web
b5b8e11c9cd8        mattermost-docker_app       "/entrypoint.sh matt…"   20 hours ago        Up 20 hours (healthy)   8000/tcp                                                               mattermost_app
a536b226af81        mattermost-docker_db        "/entrypoint.sh post…"   20 hours ago        Up 20 hours (healthy)   5432/tcp                                                               mattermost_db

/bin/bash is only available in the database container:

root@Ubuntu18:~# docker exec -ti mattermost_web /bin/bash
OCI runtime exec failed: exec failed: container_linux.go:346: starting container process caused "exec: \"/bin/bash\": stat /bin/bash: no such file or directory": unknown
root@Ubuntu18:~# docker exec -ti mattermost_app /bin/bash
OCI runtime exec failed: exec failed: container_linux.go:346: starting container process caused "exec: \"/bin/bash\": stat /bin/bash: no such file or directory": unknown
root@Ubuntu18:~# docker exec -ti mattermost_db /bin/bash
bash-5.0#

but telnet in none of them:

root@Ubuntu18:~# docker exec -ti mattermost_db /bin/bash
bash-5.0# telnet
bash: telnet: command not found
bash-5.0# telnet mail.example.com 25
bash: telnet: command not found
root@Ubuntu18:~#  docker exec -ti mattermost_web telnet mail.example.com 25
OCI runtime exec failed: exec failed: container_linux.go:346: starting container process caused "exec: \"telnet\": executable file not found in $PATH": unknown
root@Ubuntu18:~#  docker exec -ti mattermost_app telnet mail.example.com 25
OCI runtime exec failed: exec failed: container_linux.go:346: starting container process caused "exec: \"telnet\": executable file not found in $PATH": unknown
root@Ubuntu18:~#  docker exec -ti mattermost_db telnet  mail.example.com 25
OCI runtime exec failed: exec failed: container_linux.go:346: starting container process caused "exec: \"telnet\": executable file not found in $PATH": unknown

Expected behavior

no error message, running shell in container

Observed behavior

comm and not found

An issue in the docs repo has been raised for this: https://github.com/mattermost/docs/issues/3303.

1 Like