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