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.

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b371a9-2c073.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b371a9-2c073.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?