title: Using docker-compose in Dockerfile
body: <p>To create a docker image for a tileserver i want to include the generation of the tilemaps via <a href="https://github.com/openmaptiles/openmaptiles/blob/master/QUICKSTART.md" rel="nofollow noreferrer">https://github.com/openmaptiles/openmaptiles/blob/master/QUICKSTART.md</a> into the build process.</p>
  
  <p>For that i would need to "RUN docker-compose" during the image build process.</p>
  
  <pre><code>FROM debian:jessie
  
  RUN apt-get update \
      &amp;&amp; apt-get -y install apt-utils
  
  RUN apt-get update \
      &amp;&amp; apt-get -y install   ca-certificates curl
  
  ENV DOCKER_VERSION 1.12.3
  ENV COMPOSE_VERSION 1.9.0
  
  RUN curl -L https://get.docker.com/builds/Linux/x86_64/docker-${DOCKER_VERSION}.tgz &gt; /tmp/docker-${DOCKER_VERSION}.tgz \
   &amp;&amp; tar -zxf /tmp/docker-${DOCKER_VERSION}.tgz -C /tmp \
   &amp;&amp; cp /tmp/docker/docker /usr/local/bin/docker \
   &amp;&amp; chmod +x /usr/local/bin/docker \
   &amp;&amp; rm -rf /tmp/docker-${DOCKER_VERSION}.tgz /tmp/docker \
   &amp;&amp; curl -L https://github.com/docker/compose/releases/download/${COMPOSE_VERSION}/docker-compose-Linux-x86_64 &gt; /usr/local/bin/docker-compose \
   &amp;&amp; chmod +x /usr/local/bin/docker-compose
  
  # check installation
  RUN docker-compose -v
  
  # install git
  RUN apt-get -y install git-core
  
  # install gawk
  RUN apt-get -y install gawk
  
  # install make
  RUN apt-get -y install make
  
  # Clone Maptiles Repo
  RUN git clone https://github.com/digitalegarage/openmaptiles /openmaptiles
  
  RUN cd /openmaptiles \
      &amp;&amp; bash quickstart.sh bayern
  
  # Start Maptiels Server
  # on port 8080
  CMD make start-tileserver
  </code></pre>
  
  <p>Trying to build this dockerfile seems to succefully install docker-compose
  but starting docker-compose via the bash script results in the following error</p>
  
  <pre><code>Couldn't connect to Docker daemon at http+docker://localunixsocket - is it running?
  
  If it's at a non-standard location, specify the URL with the DOCKER_HOST environment variable.
  </code></pre>