I know that Docker has been built to run only one process per container (in fact it has no init process like a "normal" operating system), but I like to have an open port to connect to a container to inspect what's going on there. There's another case for which I need more than one process: one of the web sites I manage is served by a node.js http server proxyed by Apache. To allow for more high availability I start two node processes serving the same site, so that my container needs to have at least two node.js processes running at the same time and listening to two different ports. I found Monit handy to accomplish this task. The following example shows how to build an image that starts Monit which starts and monitors only the SSH daemon. As I described in a previous article , I use a setup script to build a new image, so that the Dockerfile is as small as possible. I'm not showing here the whole Dockerfile , but only the components needed to set up Monit
Scattered thoughts, mainly about about computer science and computing education.