test.Dockerfile 1.3 KB

1234567891011121314151617181920212223242526272829303132333435
  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. FROM ubuntu:20.04 AS base
  12. RUN apt-get update && apt-get install -y \
  13. curl
  14. RUN curl https://get.docker.com | sh
  15. FROM base AS install
  16. COPY install_linux.sh /scripts/install_linux.sh
  17. RUN chmod +x /scripts/install_linux.sh
  18. ARG DOWNLOAD_URL=
  19. RUN DOWNLOAD_URL=${DOWNLOAD_URL} /scripts/install_linux.sh
  20. RUN docker version | grep Cloud
  21. # check we can update
  22. FROM install AS upgrade
  23. RUN DOWNLOAD_URL=${DOWNLOAD_URL} /scripts/install_linux.sh
  24. RUN docker version | grep Cloud
  25. # To run this test locally, start an HTTP server that serves the dist/ folder
  26. # then run a docker build passing the DOWNLOAD_URL as a build arg:
  27. # $ cd dist/ && python3 -m http.server &
  28. # $ docker build -f test.Dockerfile --build-arg DOWNLOAD_URL=http://192.168.0.22:8000/docker-linux-amd64.tar.gz .