github.com/bdwilliams/libcompose@v0.3.1-0.20160826154243-d81a9bdacff0/Dockerfile (about) 1 # This file describes the standard way to build libcompose, using docker 2 FROM golang:1.7.0 3 4 5 # virtualenv is necessary to run acceptance tests 6 RUN apt-get update && \ 7 apt-get install -y iptables build-essential --no-install-recommends && \ 8 apt-get install -y python-setuptools && \ 9 easy_install pip && pip install virtualenv 10 11 # Install build dependencies 12 RUN go get github.com/aktau/github-release && \ 13 go get golang.org/x/tools/cmd/cover && \ 14 go get github.com/golang/lint/golint 15 16 # Which docker version to test on and what default one to use 17 ENV DOCKER_VERSIONS 1.9.1 1.10.3 1.11.0 18 ENV DEFAULT_DOCKER_VERSION 1.10.3 19 20 # Download docker 21 RUN set -e; \ 22 for v in $(echo ${DOCKER_VERSIONS} | cut -f1); do \ 23 if test "${v}" = "1.9.1" || test "${v}" = "1.10.3"; then \ 24 mkdir -p /usr/local/bin/docker-${v}/; \ 25 curl https://get.docker.com/builds/Linux/x86_64/docker-${v} -o /usr/local/bin/docker-${v}/docker; \ 26 chmod +x /usr/local/bin/docker-${v}/docker; \ 27 else \ 28 curl https://get.docker.com/builds/Linux/x86_64/docker-${v}.tgz -o docker-${v}.tgz; \ 29 tar xzf docker-${v}.tgz -C /usr/local/bin/; \ 30 mv /usr/local/bin/docker /usr/local/bin/docker-${v}; \ 31 rm docker-${v}.tgz; \ 32 fi \ 33 done 34 35 # Set the default Docker to be run 36 RUN ln -s /usr/local/bin/docker-${DEFAULT_DOCKER_VERSION} /usr/local/bin/docker 37 38 WORKDIR /go/src/github.com/docker/libcompose 39 40 # Compose COMMIT for acceptance test version, update that commit when 41 # you want to update the acceptance test version to support. 42 ENV COMPOSE_COMMIT 1.8.0-rc2 43 RUN virtualenv venv && \ 44 git clone https://github.com/docker/compose.git venv/compose && \ 45 cd venv/compose && \ 46 git checkout -q "$COMPOSE_COMMIT" && \ 47 ../bin/pip install \ 48 -r requirements.txt \ 49 -r requirements-dev.txt 50 51 ENV COMPOSE_BINARY /go/src/github.com/docker/libcompose/libcompose-cli 52 ENV USER root 53 54 # Compile Go for cross compilation 55 # FIXME(vdemeester) This is mainly for the vendor script, should be shared somewhere else 56 ENV DOCKER_CROSSPLATFORMS \ 57 linux/386 linux/arm \ 58 darwin/amd64 darwin/386 \ 59 freebsd/amd64 freebsd/386 freebsd/arm \ 60 windows/amd64 windows/386 61 62 # Wrap all commands in the "docker-in-docker" script to allow nested containers 63 ENTRYPOINT ["script/dind"] 64 65 COPY . /go/src/github.com/docker/libcompose