title: docker run a shell script in the background without exiting the container
body: <p>I am trying to run a shell script in my docker container. The problem is that the shell script spawns another process and it should continue to run unless another shutdown script is used to terminate the processes that are spawned by the startup script. </p>
  
  <p>When I run the below command,</p>
  
  <pre><code>docker run image:tag /bin/sh /root/my_script.sh
  </code></pre>
  
  <p>and then,</p>
  
  <pre><code>docker ps -a
  </code></pre>
  
  <p>I see that the command has exited. But this is not what I want. My question is how to let the command run in background without exiting?</p>