Using docker-compose in Dockerfile

To create a docker image for a tileserver i want to include the generation of the tilemaps via into the build process.

For that i would need to “RUN docker-compose” during the image build process.

  • Monitoring docker container from docker-java API
  • unreadable zsh shell and backspace not work on zsh shell on Docker
  • Connection refused on nginx docker container
  • error: repository [dockerimage] not found: does not exist or no pull access-docker
  • Machine created as normal user isn't visible for administrator
  • Docker NGINX Proxy not Forwarding Websockets
  • FROM debian:jessie
    RUN apt-get update \
        && apt-get -y install apt-utils
    RUN apt-get update \
        && apt-get -y install   ca-certificates curl
    RUN curl -L${DOCKER_VERSION}.tgz > /tmp/docker-${DOCKER_VERSION}.tgz \
     && tar -zxf /tmp/docker-${DOCKER_VERSION}.tgz -C /tmp \
     && cp /tmp/docker/docker /usr/local/bin/docker \
     && chmod +x /usr/local/bin/docker \
     && rm -rf /tmp/docker-${DOCKER_VERSION}.tgz /tmp/docker \
     && curl -L${COMPOSE_VERSION}/docker-compose-Linux-x86_64 > /usr/local/bin/docker-compose \
     && 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 /openmaptiles
    RUN cd /openmaptiles \
        && bash bayern
    # Start Maptiels Server
    # on port 8080
    CMD make start-tileserver

    Trying to build this dockerfile seems to succefully install docker-compose
    but starting docker-compose via the bash script results in the following error

    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.

  • ElasticSearch PORT 9300 connection refused
  • Spring Actuator - metrics aggregation from docker containers
  • How to configure docker to use /opt instead of /var
  • Deleting all Docker images from a repository
  • Docker java pass startup param to jar
  • docker private image can not be pulled in centos7
  • One Solution collect form web for “Using docker-compose in Dockerfile”

    You are getting this error because docker daemon is not running inside your container. So you need to have a connection with any host that running docker daemon and specified DOCKER_HOST env variable. I suggest you link your container with another docker-in-docker container( Take a look into one of the existing docker-in-docker solutions out there.

    Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.