Updating cmake version for those projects that require it

I’m using the Dockerfile.template for Nvidia Jetson TX2 with tag debian:stretch
I’m also trying to use HDF5 ( https://bitbucket.hdfgroup.org/scm/hdffv/hdf5.git )
Unfortunately, HDF5 requires cmake 3.10 or better, and the balena image ( resin/%%RESIN_MACHINE_NAME%%-debian:stretch) contains cmake 3.7.2

I tried to update to balenalib/%%BALENA_MACHINE_NAME%%-debian:stretch and it is missing systemctl, so more than one change required, and also uses cmake 3.7.2…

I’m going to try

RUN apt purge --auto-remove cmake \
   && mkdir /temp \
   && cd /temp \
   && curl https://cmake.org/files/v3.12/cmake-3.12.3.tar.gz > cmake.tar.gz\
   && tar -xzvf cmake.tar.gz \
   && cd cmake-3.12.3/ \
   && ./bootstrap \
   && make -j4 \
   && make install

Alternatives?

Hi,
It seems that the cmake version that’s available in the debian stretch repo is 3.7.2. Since we are not overriding the versions of already provided packages, your approach of installing cmake manually is indeed the suggested approach.

I would also suggest you to try using a multistaged build, with the -build variant being used for the steps that you are preparing your dependencies and then use a -run variant for the final image, so that you end up with a smaller file size.

Let me point you to our blog balenalib announcement about -build/-run variants, and the docker multi-staged builds docs


Now as of the systemctl, it’s indeed not included in the balenalib images, but you can install systemd on your own. Let me point you to the respective documentation page that we have:
https://www.balena.io/docs/reference/base-images/base-images/#major-changes

Kind regards,
Thodoris

1 Like