test.Dockerfile 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. # Copyright 2020 Docker Compose CLI authors
  2. # Licensed under the Apache License, Version 2.0 (the "License");
  3. # you may not use this file except in compliance with the License.
  4. # You may obtain a copy of the License at
  5. # http://www.apache.org/licenses/LICENSE-2.0
  6. # Unless required by applicable law or agreed to in writing, software
  7. # distributed under the License is distributed on an "AS IS" BASIS,
  8. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  9. # See the License for the specific language governing permissions and
  10. # limitations under the License.
  11. # Distro options: ubuntu, centos
  12. ARG DISTRO=ubuntu
  13. FROM ubuntu:20.04 AS base-ubuntu
  14. RUN apt-get update && apt-get install -y \
  15. curl
  16. RUN curl https://get.docker.com | sh
  17. FROM centos:7 AS base-centos
  18. RUN curl https://get.docker.com | sh
  19. FROM base-${DISTRO} AS install
  20. COPY install_linux.sh /scripts/install_linux.sh
  21. RUN chmod +x /scripts/install_linux.sh
  22. ARG DOWNLOAD_URL=
  23. RUN DOWNLOAD_URL=${DOWNLOAD_URL} /scripts/install_linux.sh
  24. RUN docker version | grep Cloud
  25. FROM install AS upgrade
  26. RUN DOWNLOAD_URL=${DOWNLOAD_URL} /scripts/install_linux.sh
  27. RUN docker version | grep Cloud
  28. # To run this test locally, start an HTTP server that serves the dist/ folder
  29. # then run a docker build passing the DOWNLOAD_URL as a build arg:
  30. # $ cd dist/ && python3 -m http.server &
  31. # $ docker build -f test.Dockerfile --build-arg DOWNLOAD_URL=http://192.168.0.22:8000/docker-linux-amd64.tar.gz .
  32. #
  33. # You can specify centos or ubuntu as distros using the DISTRO build arg.