# Building new docker image error - Cmake version not good

Source: https://forum.modalai.com/topic/970/building-new-docker-image-error-cmake-version-not-good
Category: VOXL SDK and Software (https://forum.modalai.com/category/47/voxl-sdk-and-software)
Posted: 2022-06-01 17:20:09 UTC by marian
Replies: 9 · Views: 3603

## marian · 2022-06-01 17:20:09 UTC

Hello, 

I'm trying to build a new docker image on Voxl Flight deck and I get this error: 

Step 10 : RUN cmake -DCMAKE_BUILD_TYPE=Debug -DBUILD_SHARED_LIBS=ON -Bbuild/default -H.
 ---> Running in 88527c85a1aa
CMake Error at CMakeLists.txt:1 (cmake_minimum_required):
  CMake 3.13 or higher is required.  You are running version 3.10.2

In the existent image the verison is till 3.10.2 and is the newest as seeing below:

root@apq8096:/home/MAVSDK/examples/takeoff_land# apt-get install cmake 
Reading package lists... Done
Building dependency tree       
Reading state information... Done
cmake is already the newest version (3.10.2-1ubuntu2.18.04.2).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

Please let me know how to deal with it.

## Reply by Chad Sweet (ModalAI staff) · 2022-06-01 17:24:16 UTC

It looks like you need to be using a newer version of cmake. Can you share the Docker file? make sure you're running 'apt update' to get the latest packages

## Reply by Eric Katzfey (ModalAI staff) · 2022-06-01 17:25:27 UTC

What file system are you using in your Docker? A version of Ubuntu?

## Reply by marian · 2022-06-02 07:08:18 UTC

@Chad-Sweet The docker file was downloaded from here https://gitlab.com/voxl-public/voxl-docker-images/voxl-docker-mavsdk-cpp 

The Docker file:
yocto:/data/docker/mavsdk-cpp$ more Dockerfile 
FROM arm64v8/ubuntu:bionic

WORKDIR /home

RUN apt-get update
RUN apt-get install cmake build-essential colordiff git doxygen -y
RUN apt install git -y

RUN git clone https://github.com/mavlink/MAVSDK.git

WORKDIR /home/MAVSDK
RUN git checkout main
RUN git submodule update --init --recursive

RUN cmake -DCMAKE_BUILD_TYPE=Debug -DBUILD_SHARED_LIBS=ON -Bbuild/default -H.
RUN cmake --build build/default --target install
RUN ldconfig

WORKDIR /home/MAVSDK/examples/takeoff_land
COPY takeoff_and_land.cpp .
RUN cmake .
RUN make

CMD ["/bin/bash"]

@Eric-Katzfey I activated docker on VOXL with voxl-configure-docker.sh and i use the system versiondelivered with the voxl deck, I didn't change it. 

Here are the info of system version:

/ # bash
yocto:/$ uname -a
Linux apq8096 3.18.71-perf #1 SMP PREEMPT Sun Jun 6 19:41:01 UTC 2021 aarch64 GNU/Linux
yocto:/$ 

yocto:/$ docker run -it --rm --privileged --net=host gcr.io/modalai-public/voxl-mavsdk-cpp:v1.0 /bin/bash
root@apq8096:/home/MAVSDK/examples/takeoff_land# uname -a 
Linux apq8096 3.18.71-perf #1 SMP PREEMPT Sun Jun 6 19:41:01 UTC 2021 aarch64 aarch64 aarch64 GNU/Linux
root@apq8096:/home/MAVSDK/examples/takeoff_land#

## Reply by Eric Katzfey (ModalAI staff) · 2022-06-03 15:37:42 UTC

I found these instructions for updating cmake https://askubuntu.com/questions/355565/how-do-i-install-the-latest-version-of-cmake-from-the-command-line. You can try these instructions to update the cmake version.

## Reply by marian · 2022-06-16 07:44:04 UTC

Hi @Eric-Katzfey I followed up the full reinstall of the cmake in docker on voxl platform, and it is goes well but once I exited from the docker and come back it put back the 3.10.2 version as show below:

![Screenshot 2022-06-16 at 10.39.29.png](https://forum.modalai.com/assets/uploads/files/1655365398370-screenshot-2022-06-16-at-10.39.29.png) 

Could you, please, guide me forward to resolve this?

## Reply by Chad Sweet (ModalAI staff) · 2022-06-16 14:11:39 UTC

This post on stack overflow might help? https://stackoverflow.com/questions/44480740/how-to-save-a-docker-container-state

## Reply by CY-1992 · 2022-06-16 20:46:35 UTC

@marian Try to use base image arm64v8/ubuntu:20.04 in Dockerfile. It has the latest cmake version. 

```
FROM arm64v8/ubuntu:20.04
```

## Reply by Eric Katzfey (ModalAI staff) · 2022-06-17 16:20:47 UTC (in reply to marian)

@marian Anything you do while a docker image is running (as a container) isn't saved back to the base image. There are generally 2 ways to approach this. The preferred method is to add the new commands to the dockerfile and rebuild the image. The second approach is to run docker commit to save changes to a currently running container https://docs.docker.com/engine/reference/commandline/commit/.

## Reply by marian · 2022-06-18 07:50:52 UTC

@CY-1992 said in [Building new docker image error \- Cmake version not good](/post/4769):
> ubuntu:20.04

Thanks @CY-1992 is working just fine!
