title: How to run bash in detached mode in docker?
body: <p><code>docker run -d ubuntu bash</code>
  Container will immediately exit. What I need is keeping the container run, and I can use <code>exec</code> to login into this container.</p>
  
  <p>In fact, I need do these things in a bash script:</p>
  
  <pre><code>docker run -it ubuntu bash
  docker run -it centos bash
  </code></pre>
  
  <p>But it does not work.</p>