Update to minimum CMake 3.5

And modernise some examples.
This commit is contained in:
Thom Troy
2018-03-18 17:23:57 +00:00
parent 54e75664c1
commit b81da6f68b
52 changed files with 303 additions and 212 deletions

View File

@@ -22,7 +22,7 @@ For example:
[source,bash]
----
$ docker build --rm -f ubuntu14.04-cmake-3.4.3 -t matrim/cmake-examples:3.4.3 .
$ docker build --rm -f ubuntu14.04-cmake-3.5.1 -t matrim/cmake-examples:3.5.1 .
----
In this example the tag is created as follows
@@ -35,7 +35,17 @@ This will tag the container as belong to my repositry with the label of the cont
I have pre-build images and pushed them to the https://hub.docker.com[docker hub] in the repository https://hub.docker.com/r/matrim/cmake-examples/[matrim/cmake-examples].
The images available include the following versions of cmake:
The current usable images include the following versions of cmake:
* Ubuntu 16.04 with CMake 3.5.1
$ docker pull docker pull matrim/cmake-examples:3.5.1
* Ubuntu 16.04 with CMake 3.10.3
$ docker pull docker pull matrim/cmake-examples:3.10.3
Some old images which work with older version of the repository include:
* Ubuntu 14.04 with CMake 2.8.12.2
@@ -45,10 +55,6 @@ The images available include the following versions of cmake:
$ docker pull docker pull matrim/cmake-examples:3.4.3
* Ubuntu 16.04 with CMake 3.5.1
$ docker pull docker pull matrim/cmake-examples:3.5.1
# Running
When run the images will automatically create a non root user called devuser, with a default command to launch a bash shell in the users home directory.
@@ -59,7 +65,7 @@ For example
[source,bash]
----
docker run -e DEV_UID=`id -u` -e DEV_GID=`id -u` -it matrim/cmake-examples:3.4.3
docker run -e DEV_UID=`id -u` -e DEV_GID=`id -u` -it matrim/cmake-examples:3.5.1
----
@@ -67,7 +73,7 @@ To build the full set of cmake-examples test cases you can run:
[source,bash]
----
docker run -it matrim/cmake-examples:3.4.3
docker run -it matrim/cmake-examples:3.5.1
git clone https://github.com/ttroy50/cmake-examples.git
cd cmake-examples
./test.sh
@@ -80,5 +86,5 @@ Below is an example of loading a volume and automatically running all cmake-exam
[source,bash]
----
docker run --rm -e DEV_UID=`id -u` -e DEV_GID=`id -u` -v /checkout/directory:/data/code -it matrim/cmake-examples:3.4.3 /data/code/test.sh
docker run --rm -e DEV_UID=`id -u` -e DEV_GID=`id -u` -v /checkout/directory:/data/code -it matrim/cmake-examples:3.5.1 /data/code/test.sh
----

View File

@@ -0,0 +1,49 @@
# Container for building and testing cmake-examples with CMake 3.10.3
FROM ubuntu:16.04
MAINTAINER Thom Troy
RUN apt-get update && apt-get install -y build-essential \
sudo \
cmake \
libboost-all-dev \
libprotobuf-dev \
protobuf-compiler \
clang-3.6 \
clang-format-3.6 \
ninja-build \
wget \
git \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
RUN cd /usr/local/src \
&& wget https://cmake.org/files/v3.10/cmake-3.10.3.tar.gz \
&& tar xvf cmake-3.10.3.tar.gz \
&& cd cmake-3.10.3 \
&& ./bootstrap \
&& make \
&& make install \
&& cd .. \
&& rm -rf cmake*
# cppcheck
RUN cd /usr/local/src \
&& wget https://github.com/danmar/cppcheck/archive/1.79.tar.gz \
&& tar xvf 1.79.tar.gz \
&& cd cppcheck-1.79 \
&& mkdir build \
&& cd build \
&& cmake .. \
&& make install \
&& cd ../.. && rm -rf cppcheck*
RUN cd /usr/local/src \
&& wget https://github.com/tianon/gosu/releases/download/1.10/gosu-amd64 \
&& mv gosu-amd64 /usr/local/bin/gosu \
&& chmod +x /usr/local/bin/gosu
ADD setup.sh /setup.sh
RUN chmod +x /setup.sh
CMD ["/bin/bash"]
ENTRYPOINT ["/setup.sh"]