Dockerfile 1.3 KB

123456789101112131415161718192021222324252627282930313233343536
  1. # Distributed under the OSI-approved BSD 3-Clause License. See accompanying
  2. # file Copyright.txt or https://cmake.org/licensing for details.
  3. # Produce an image containing a portable CMake binary package for Linux/x86_64.
  4. # Build using the CMake source directory as the build context.
  5. # The resulting image will have an '/out' directory containing the package.
  6. ARG FROM_IMAGE_NAME=kitware/cmake:build-linux-x86_64-deps-2019-08-09
  7. ARG FROM_IMAGE_DIGEST=@sha256:630c320b26a67fc584e0bc98314f1fb0cb0abc764348bb2613ef07437f7101f9
  8. ARG FROM_IMAGE=$FROM_IMAGE_NAME$FROM_IMAGE_DIGEST
  9. FROM $FROM_IMAGE
  10. COPY . /opt/cmake/src/cmake
  11. ARG TEST=true
  12. RUN : \
  13. && mkdir -p /opt/cmake/src/cmake-build \
  14. && cd /opt/cmake/src/cmake-build \
  15. && cp ../cmake/Utilities/Release/linux/x86_64/cache.txt CMakeCache.txt \
  16. && source /opt/rh/devtoolset-6/enable \
  17. && source /opt/rh/rh-python36/enable \
  18. && export LANG=en_US.UTF-8 \
  19. && set -x \
  20. && ../cmake/bootstrap --parallel=$(nproc) --docdir=doc/cmake \
  21. && nice make -j $(nproc) \
  22. && if $TEST; then \
  23. # Run tests that require the full build tree.
  24. bin/ctest --output-on-failure -j 8 -R '^(CMake\.|CMakeLib\.|CMakeServerLib\.|RunCMake\.ctest_memcheck)'; \
  25. fi \
  26. && bin/cpack -G TGZ \
  27. && bin/cpack -G STGZ \
  28. && set +x \
  29. && mkdir /out \
  30. && mv cmake-*-Linux-x86_64.* /out \
  31. && :