title: jenkins in docker - Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?
body: <p>I'm running <a href="https://hub.docker.com/r/jenkinsci/blueocean/" rel="nofollow noreferrer">https://hub.docker.com/r/jenkinsci/blueocean/</a> in docker.  Trying to build a docker image in jenkins.</p>
  
  <p>but i get the following error:</p>
  
  <pre><code>Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?
  </code></pre>
  
  <p>clearly the jenkins version in docker does not have access to the docker binary.</p>
  
  <p>I confirmed this by, </p>
  
  <pre><code>docker exec -it db4292380977 bash
  docker images
  Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?
  </code></pre>
  
  <p>"db4292380977" is the running container. It shows the same error.</p>
  
  <p>Question:</p>
  
  <ul>
  <li>how do I allow access to docker in the jenkins container?</li>
  </ul>