Category: Docker, yaml, shell

Have you ever faced this scenario where you want to run two or more lightweight services or multiple executables within the same container when the image starts running? But sometimes we want to run two or more lightweight services inside the same container. While working with Docker on a use case wherein I was supposed to implement two processes in a single docker container.

We will run Supervisord in the foreground and supervisord.conf file that has to be passed in the Dockerfile in which we can tell multiple processes to be run inside Docker container.

Finally when we spawn the container , we see httpd and sshd coming up on runtime: When we look at all the ports and services open via : “ss -tln” command in Linux we can see some ports coming up: When I say that SSHd service is up and running on the container at runtime along with spawn & boot, then we need to confirm this by taking ssh access to this container, lets see what port is up and how to take access: We can get the SSH access and get started by using it : To see the configurations sent in Supervisord for SSH service: There are supervisord.conf standard configurations that have to be made, this is what the file looks like: What are we doing here?

Related Articles