title: How can I run docker-compose up as shell script by Jenkins
body: <p>I am trying to run command <code>docker-compose up -d</code> as a build step of Jenkins, in "execute shell". Job fails and gives me following console log:</p>
  
  <blockquote>
    <p>docker-compose up --build -d
    Couldn't connect to Docker daemon at http+docker://localunixsocket - is it running?</p>
    
    <p>If it's at a non-standard location, specify the URL with the DOCKER_HOST environment variable.
    Build step 'Execute shell' marked build as failure
    Finished: FAILURE`</p>
  </blockquote>
  
  <p>When I cd into jenkins workspace (/var/lib/jenkins/workspace/app/) and tried to run docker-compose up, at first I could get a normal build. Right now I get error in console: <code>ERROR: Error processing tar file(archive/tar: invalid tar header):</code>. Of course app builds and runs normally in home directory when invoked from console.</p>
  
  <p>Docker is running on host. It is possible to run docker-compose by regular user. I did add jenkins user to docker group. I even tried following some asian tutorial from <a href="http://blog.csdn.net/qiyueqinglian/article/details/46559825" rel="nofollow noreferrer">http://blog.csdn.net/qiyueqinglian/article/details/46559825</a> that made me change DOCKER_OPTS in default/docker, but after restarting docker service it was not running on port 4243, so I didn't understood translation or it is not working on ubuntu 16.04 (host system).</p>
  
  <p>Jenkins is not running in container, it is casually installed on host, no VM no docker, nothing. I tried removing docker and jenkins completly from host (purge etc) and reinstalling, still the same errors.</p>
  
  <p>Any ideas?</p>