title: /var/run/docker.sock: permission denied while running docker within Python CGI script
body: <p>I am trying to run Python CGI script inside which I need to run docker image.
  I am using Docker version 1.6.2. user is "www-data", which is added in docker group.</p>
  
  <pre><code>www-data : www-data sudo docker 
  </code></pre>
  
  <p>On machine, with www-data I am able to execute docker commands</p>
  
  <pre><code>www-data@mytest:~/html/new$ docker ps
  CONTAINER ID        IMAGE               COMMAND             CREATED             STATUS              PORTS               NAMES
  </code></pre>
  
  <p>I am getting following error while running docker image from Python CGI script:</p>
  
  <pre><code>fatal msg="Get http:///var/run/docker.sock/v1.18/images/json: dial unix /var/run/docker.sock: permission denied. Are you trying to connect to a TLS-enabled daemon without TLS?" 
  </code></pre>
  
  <p>Is there anything I am missing here?</p>