简体   繁体   中英

docker CMD run supervisord in background

is there any way to run supervisord in the background. means start the process and get out of shell.

I have a docker file where i try to run a script that suppose to start the postgresql and then get out. so I have a process running and i can create users. Docker command

CMD  ["/runprocess.sh"]

script runproccess.sh

#!/bin/bash
supervisord -c "/etc/supervisord.conf"

I have also tried to run it in background, but no luck

#!/bin/bash
supervisord -c "/etc/supervisord.conf" &

supervisord starts the process and just stays on screen for ever. i want it to run the process and get out. so I can run other part of my script.

you can remove setting nodaemon or set it to false in supervisord.conf

[supervisord]
nodaemon=false ; Docker利用ではtrueにする必要あり

this will make supervisor start in background.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM