Use one container to manage multiple application service processes? Or does each service process create a container?

  docker, question

Use one container to manage multiple application service processes? Or does each service process create a container?

What are the differences?

How to dismantle the business in docker and how to dismantle it are actually matters of different opinions.

For example, the docker container of gogs starts the following things:

s6-svscan-+-s6-supervise
 |-s6-supervise---gogs
 |-s6-supervise---sshd
 `-s6-supervise---syslogd

Explain that the general container starts as follows:

1. The init process with PID = 1 generally uses supervisord, and some people use s6, such as gogs mentioned above.  This process is mainly used to keep the process alive and restart the process.
 2. agent is generally used for monitoring, and some agents may be used to execute commands, etc. For example, some companies will insert an agent into java container, and can execute jmap and other operations when abnormal.
 3. The business process is generally attached to the init process.  It is rare to see the business process as the main process (init process).  Because the main process (init process) kneels, docker kneels.
 4. Other affiliated processes, such as gogs mentioned above, will initiate an sshd.  Some will also start other services such as syslogd.

For individuals:

Take a chestnut, gitlab.
 For individuals, it is completely convenient to put all the services required by gitlab into the same dock.
 These include:
 1. nginx
 2. sshd
 3. mysql
 4. gitlab(unicorn)

But in fact, this cannot be done in a production environment.

At the very least, even if mysql cannot be hosted by DBA, it should not be placed in the same docker. At the very least, it should also be used as an association container. mysql is placed in one basket and gitlab is placed in another basket.

In terms of business, it is no longer the same thing.

In terms of stability, it is not recommended either.

This is the bottom-line code of ethics for using docker and cannot be lowered any further.

How do others dismantle gitlab’s business?