title: How to run docker:dind to start with a shell
body: <p>I want to run <code>docker:dind</code> and get a shell.<br>
  If I run <code>docker run --privileged docker:dind sh</code> it just exit.<br>
  The workaround is to run: <code>docker run -d --privileged docker:dind</code><br>
  it starts in the background and then I can run <code>docker exec -it &lt;container&gt; sh</code> and get a shell.  </p>
  
  <p>But I want that it will start with a shell.<br>
  I created a Dockerfile:    </p>
  
  <pre><code>FROM docker:dind
  ENTRYPOINT sh  
  </code></pre>
  
  <p>I built it:<br>
  <code>docker build -t dind2 -f Dockerfile .</code>   </p>
  
  <p>When I run <code>docker run --rm -it --privileged dind2</code> I get a shell but when I tried to run simple container <code>docker run busybox echo hi</code> it failed with:  </p>
  
  <pre><code>docker: Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?.  
  </code></pre>
  
  <p>Any idea how make <code>docker:dind</code> start with a shell without the workaround of running it in the background and then using <code>exec</code> to get a shell.  </p>