title: Commands to execute background process in Docker CMD
body: <p>I am creating a docker image using a Dockerfile. I would like to execute some scripts while starting the docker container. Currently I have a shell script to execute all the necessary processes</p>
  
  <blockquote>
    <p>CMD ["sh","start.sh"]</p>
  </blockquote>
  
  <p>I would like to execute a shell command with a process running in background example </p>
  
  <blockquote>
    <p>CMD ["sh", "-c", "mongod --dbpath /test &amp;"]</p>
  </blockquote>