title: AWS Build Project service docker-compose build command not working
body: <p>I want to build docker images and push into ECR for that I have written below buildspect.yml file and build my project using AWS build project service.
  My buildspec.yml file is as below:</p>
  <pre><code>version: 0.2
   
  
  
  phases:
    install:
      runtime-versions:
        docker: 18
      commands: 
        - nohup /usr/local/bin/dockerd --host=unix:///var/run/docker.sock --host=tcp://localhost:2375 --storage-driver=overlay2&amp;
        - timeout 15 sh -c &quot;until docker info; do echo .; sleep 1; done&quot;
    pre_build:
     commands:
       - $(aws ecr get-login --no-include-email --region ${AWS_DEFAULT_REGION})
       - REPOSITORY_URI_SERVER=&lt;accountnumber&gt;.dkr.ecr.${AWS_DEFAULT_REGION}.amazonaws.com/${IMAGE_NAME}
    build:
      commands:
       - docker-compose build
    post_build:
      commands:
       - docker-compose push
      
  </code></pre>
  <p>While I do build using AWS build project service then I will get an error like:</p>
  <pre><code>ERROR: Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?
  errors pretty printing info
  [Container] 2020/07/10 01:57:15 Command did not exit successfully timeout 15 sh -c &quot;until docker info; do echo .; sleep 1; done&quot; exit status 124
  [Container] 2020/07/10 01:57:15 Phase complete: INSTALL State: FAILED
  [Container] 2020/07/10 01:57:15 Phase context status code: COMMAND_EXECUTION_ERROR Message: Error while executing command: timeout 15 sh -c &quot;until docker info; do echo .; sleep 1; done&quot;. Reason: exit status 124
  </code></pre>