title: Docker/Node error: Error: connect ENOENT /var/run/docker.sock
body: <p>I'm trying to get a simple Dockerfile to run a node application and so far it has been difficult. I have finally got it to run and compile, however I am running into the following error. This is my first dockerfile and I really haven't seen this error before or online:</p>
  
  <pre><code>patientplatypus:~/Documents/pypy-sandbox-server:18:42:13$sudo docker run -it compile
  
  &gt; pypy-sandbox-server@1.0.0 start /
  &gt; npm install &amp;&amp; node api/app.js
  
  npm WARN pypy-sandbox-server@1.0.0 No repository field.
  
  up to date in 1.352s
  in app.js - SANITY CHECK
  info: Initializing Sandbox
  error:  Error: connect ENOENT /var/run/docker.sock
      at Object._errnoException (util.js:1024:11)
      at _exceptionWithHostPort (util.js:1046:20)
      at PipeConnectWrap.afterConnect [as oncomplete] (net.js:1185:14)
  </code></pre>
  
  <p>My dockerfile itself should be pretty simple. The only "tricky thing" I'm doing is composing more than one docker image (this is necessary for my particular use case). The node part (below) is very simple however: </p>
  
  <pre><code>FROM node:8 as node_env
  WORKDIR .
  #COPY package.json .
  COPY . .
  RUN apt-get -qq update
  RUN apt-get -qq -y install npm
  RUN apt-get install -qq -y --no-install-recommends apt-utils
  RUN npm set progress=false &amp;&amp; \
      npm config set depth 0 &amp;&amp; \
      npm install
  EXPOSE 3000
  COPY --from=pypy_build usr/local/bin/pypy ./pypy
  #CMD ["forever", "-c","node --harmony","./api/app.js"]
  ENTRYPOINT npm start
  </code></pre>
  
  <p>What is going wrong?</p>