I use a Docker container for doing scientific calculations. All my libraries are installed inside the docker container. In addition, I got ParaView installed in order to do live visualizations.
For my simulation pipeline, I need to keep a ParaView server running inside the container while working with my bash shell inside it. A working solution for me is to use tmux as a terminal multiplexer, start the pvserver in one terminal session and use the other to do my simulation stuff.
However, this is very inconvenient and I would like to start the ParaView server on each start of the container automatically in the background. For this purpose, I tried to modify the ENTRYPOINT as:
ENTRYPOINT pvserver && /bin/bash
This works but does not allow me to use the shell, nor can I move the pvserver process in the background. Therefore it does not solve the issue of not using tmux for me. Then I tried to move the pvserver
command into a CMD block, but that only starts and directly ends the process. So how can I start the server in the background while still being able to use the shell as usual when starting the container with the -it
flag.
Generally, I read a couple of questions regarding this topic already, but most of the questions (or the docker documentation itself) focus either running just one process in the background and using bash as main process to not terminate the container, or they focus on running multiple predefined processes (not the shell) simultaneously like in the documentation.