Dockerfile 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. # This file describes the standard way to build libcompose, using docker
  2. FROM golang:1.6.2
  3. # virtualenv is necessary to run acceptance tests
  4. RUN apt-get update && \
  5. apt-get install -y iptables build-essential --no-install-recommends && \
  6. apt-get install -y python-setuptools && \
  7. easy_install pip && pip install virtualenv
  8. # Install build dependencies
  9. RUN go get github.com/aktau/github-release && \
  10. go get golang.org/x/tools/cmd/cover && \
  11. go get github.com/golang/lint/golint
  12. # Which docker version to test on and what default one to use
  13. ENV DOCKER_VERSIONS 1.9.1 1.10.3 1.11.0
  14. ENV DEFAULT_DOCKER_VERSION 1.10.3
  15. # Download docker
  16. RUN set -e; \
  17. for v in $(echo ${DOCKER_VERSIONS} | cut -f1); do \
  18. if test "${v}" = "1.9.1" || test "${v}" = "1.10.3"; then \
  19. mkdir -p /usr/local/bin/docker-${v}/; \
  20. curl https://get.docker.com/builds/Linux/x86_64/docker-${v} -o /usr/local/bin/docker-${v}/docker; \
  21. chmod +x /usr/local/bin/docker-${v}/docker; \
  22. else \
  23. curl https://get.docker.com/builds/Linux/x86_64/docker-${v}.tgz -o docker-${v}.tgz; \
  24. tar xzf docker-${v}.tgz -C /usr/local/bin/; \
  25. mv /usr/local/bin/docker /usr/local/bin/docker-${v}; \
  26. rm docker-${v}.tgz; \
  27. fi \
  28. done
  29. # Set the default Docker to be run
  30. RUN ln -s /usr/local/bin/docker-${DEFAULT_DOCKER_VERSION} /usr/local/bin/docker
  31. WORKDIR /go/src/github.com/docker/libcompose
  32. # Compose COMMIT for acceptance test version, update that commit when
  33. # you want to update the acceptance test version to support.
  34. ENV COMPOSE_COMMIT e2cb7b0237085415ce48900309a61c73b5938520
  35. RUN virtualenv venv && \
  36. git clone https://github.com/docker/compose.git venv/compose && \
  37. cd venv/compose && \
  38. git checkout -q "$COMPOSE_COMMIT" && \
  39. ../bin/pip install \
  40. -r requirements.txt \
  41. -r requirements-dev.txt
  42. ENV COMPOSE_BINARY /go/src/github.com/docker/libcompose/libcompose-cli
  43. ENV USER root
  44. # Wrap all commands in the "docker-in-docker" script to allow nested containers
  45. ENTRYPOINT ["script/dind"]
  46. COPY . /go/src/github.com/docker/libcompose