title: Couldn't connect to Docker daemon at http+docker://localhost with docker-compose
body: <p>I have this React app that I want to run on an Apache HTTP Docker container.</p>
  
  <p>So I created a <strong>Dockerfile</strong> that works with <code>sudo docker build</code> and <code>sudo docker run &lt;name&gt;</code></p>
  
  <pre><code>FROM httpd:2.4
  COPY ./dist/ /usr/local/apache2/htdocs/
  </code></pre>
  
  <p>I created a <strong>docker-compose.yml</strong></p>
  
  <pre><code>version: '3'
  services:
    frontend:
      build: .
      ports:
       - "8080:80"
      container_name: frontend
  </code></pre>
  
  <p>But when I run <code>sudo docker-compose build</code> I get this error: </p>
  
  <blockquote>
    <p>ERROR: Couldn't connect to Docker daemon at http+docker://localhost -
    is it running?</p>
    
    <p>If it's at a non-standard location, specify the URL with the
    DOCKER_HOST environment variable.</p>
  </blockquote>
  
  <p>What is the problem?</p>