title: Docker quits after script has been executed
body: <p>I have docker container starting with command: </p>
  
  <pre><code>"CMD [\"/bin/bash\", \"/usr/bin/gen_new_key.sh\"]"
  </code></pre>
  
  <p>script looks like:</p>
  
  <pre><code>#!/bin/bash
  /usr/bin/generate_signing_key -k xxxx -r eu-west-2 &gt; /usr/local/nginx/s3_signature_key.txt
  
  { read -r val1
    read -r val2
    sed -i "s!AWS_SIGNING_KEY!'$val1'!;
            s!AWS_KEY_SCOPE!'$val2'!;
    " /etc/nginx/nginx.conf
  } &lt; /usr/local/nginx/s3_signature_key.txt
  
  if [ -z "$(pgrep nginx)" ]
    then
       nginx -c /etc/nginx/nginx.conf
    else
       nginx -s reload
  fi
  </code></pre>
  
  <p>Script is working itself as I can see all data in docker layer in /var/lib/docker..
  It is intended to run it by cron for every 5 days as AWS signature key generated in first line is valid for 7 days only. How can I prevent Docker to quit after script is finished and keep is running?</p>