How to start another process by running springboot, in the docker container

when we run a springboot project in a dockerized test environment, we often encounter a problem: there are occasional problems in the developed code, which causes springboot not to start, because springboot (that is, the java process) is the main process of the container, so the container fails to start, which in turn triggers the marathon/k8s health check failure, and then frequently restarts the project. However, because it is a test environment, the developer wants to see the "accident scene" and frequently restarts and loses the "accident scene".

to solve this problem, I"m not going to use the java thread as the main process, and I need to use components such as supervisor at this point. Does the company have a container multi-process scene? What are the best practices?


your understanding of docker is wrong. According to the design of docker, a container has one and only one process. Running multiple processes is not a docker application scenario, and docker believes that this should not be done.

Menu