diff options
author | Brad King <brad.king@kitware.com> | 2019-08-23 18:27:14 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2019-08-28 17:20:36 (GMT) |
commit | facc240a45cb81f4437c7c41cf97ecb8d5b0ce55 (patch) | |
tree | ad68450ef9dcabdf32fe5711a3d899b57f55ea0d /Utilities/Release/README.rst | |
parent | bf832ccf01894bf605c17a89f2bc3babd24df108 (diff) | |
download | CMake-facc240a45cb81f4437c7c41cf97ecb8d5b0ce55.zip CMake-facc240a45cb81f4437c7c41cf97ecb8d5b0ce55.tar.gz CMake-facc240a45cb81f4437c7c41cf97ecb8d5b0ce55.tar.bz2 |
Utilities/Release: Add docker specs to build and test Linux binaries
These will allow anyone to produce portable binaries like those
published on `cmake.org`.
Diffstat (limited to 'Utilities/Release/README.rst')
-rw-r--r-- | Utilities/Release/README.rst | 57 |
1 files changed, 57 insertions, 0 deletions
diff --git a/Utilities/Release/README.rst b/Utilities/Release/README.rst index 3752e06..e7f0eb3 100644 --- a/Utilities/Release/README.rst +++ b/Utilities/Release/README.rst @@ -6,6 +6,63 @@ on ``cmake.org``. See also the `CMake Source Code Guide`_. .. _`CMake Source Code Guide`: ../../Help/dev/source.rst +Docker +------ + +The ``linux/<arch>/`` directories contain Docker specifications that anyone +may use to produce Linux binaries for CMake: + +* ``linux/<arch>/base/Dockerfile``: + Produces a base image with a build environment for portable CMake binaries. + This image is published in the `kitware/cmake Docker Hub Repository`_ + with tag ``build-linux-<arch>-base-<date>``. + +* ``linux/<arch>/deps/Dockerfile``: + Produces an image with custom-built dependencies for portable CMake binaries. + This image is published in the `kitware/cmake Docker Hub Repository`_ + with tag ``build-linux-<arch>-deps-<date>``. + +* ``linux/<arch>/Dockerfile``: + Produce an image containing a portable CMake binary package for Linux. + Build this image using the CMake source directory as the build context. + The resulting image will have an ``/out`` directory containing the package. + For example: + + .. code-block:: console + + $ docker build --tag=cmake:build --network none \ + -f cmake-src/Utilities/Release/linux/$arch/Dockerfile cmake-src + $ docker container create --name cmake-build cmake:build + $ docker cp cmake-build:/out . + $ ls out/cmake-*-Linux-$arch.tar.gz + +* ``linux/<arch>/test/Dockerfile``: + Produces a base image with a test environment for packaged CMake binaries. + For example, build the test base image: + + .. code-block:: console + + $ docker build --tag=cmake:test-base \ + cmake-src/Utilities/Release/linux/$arch/test + + Then create a local ``test/Dockerfile`` to prepare an image with both the + CMake source tree and the above-built package:: + + FROM cmake:test-base + COPY cmake-src /opt/cmake/src/cmake + ADD out/cmake-<ver>-Linux-<arch>.tar.gz /opt/ + ENV PATH=/opt/cmake-<ver>-Linux-<arch>/bin:$PATH + + Build the test image and run it to drive testing: + + .. code-block:: console + + $ docker build --tag cmake:test --network none -f test/Dockerfile . + $ docker run --network none cmake:test bash test-make.bash + $ docker run --network none cmake:test bash test-ninja.bash + +.. _`kitware/cmake Docker Hub Repository`: https://hub.docker.com/r/kitware/cmake + Scripts for Kitware ------------------- |