Building new docker image error - Cmake version not good
-
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.2In 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.
-
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
-
What file system are you using in your Docker? A version of Ubuntu?
-
@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:bionicWORKDIR /home
RUN apt-get update
RUN apt-get install cmake build-essential colordiff git doxygen -y
RUN apt install git -yRUN git clone https://github.com/mavlink/MAVSDK.git
WORKDIR /home/MAVSDK
RUN git checkout main
RUN git submodule update --init --recursiveRUN cmake -DCMAKE_BUILD_TYPE=Debug -DBUILD_SHARED_LIBS=ON -Bbuild/default -H.
RUN cmake --build build/default --target install
RUN ldconfigWORKDIR /home/MAVSDK/examples/takeoff_land
COPY takeoff_and_land.cpp .
RUN cmake .
RUN makeCMD ["/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# -
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.
-
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:
Could you, please, guide me forward to resolve this?
-
This post on stack overflow might help? https://stackoverflow.com/questions/44480740/how-to-save-a-docker-container-state
-
@marian Try to use base image arm64v8/ubuntu:20.04 in Dockerfile. It has the latest cmake version.
FROM arm64v8/ubuntu:20.04
-
@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/.
-
@CY-1992 said in Building new docker image error - Cmake version not good:
ubuntu:20.04
Thanks @CY-1992 is working just fine!