Usually each container should hosts one process. In case you need multiple processes in one container (e.g. an SSH server to login to your running container instance) you could get the idea to write you own shell script that starts those processes. In that case you had to take care about the SIGNAL
handling yourself (e.g. redirecting a caught SIGINT
to the child processes of your script). That's not really what you want. A simple solution is to use supervisord
as the containers root process which takes care about SIGNAL
handling and its child processes lifetime.
But keep in mind, that this ist not the "docker way". To achive this example in the docker way you would log into the docker host
(the machine the container runs on) and run docker exec -it container_name /bin/bahs
. This command opens you a shell inside the container as ssh would do.