From 9c9cdc8b31ad1b31f694f8fc91d1972fa80ad1c8 Mon Sep 17 00:00:00 2001 From: Alex Bailo Date: Mon, 11 Nov 2024 23:15:24 +0100 Subject: [PATCH] Update Dockerfile to install OpenCV v4.10.0 --- Dockerfile | 15 +++++++-------- python_utils/requirements_dev.txt | 6 +++--- python_utils/requirements_prod.txt | 6 +++--- 3 files changed, 13 insertions(+), 14 deletions(-) diff --git a/Dockerfile b/Dockerfile index c86218a9..7ec47fae 100755 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM ubuntu:20.04 as prod +FROM ubuntu:24.04 as prod ENV DEBIAN_FRONTEND noninteractive RUN apt update && apt install -y --no-install-recommends apt-utils && \ @@ -15,14 +15,14 @@ WORKDIR /home #------------------------------ # # INSTALL OPENCV 4 # #------------------------------ # -RUN wget -O opencv.zip https://github.com/opencv/opencv/archive/4.2.0.zip && \ - wget -O opencv_contrib.zip https://github.com/opencv/opencv_contrib/archive/4.2.0.zip && \ +RUN wget -O opencv.zip https://github.com/opencv/opencv/archive/4.10.0.zip && \ + wget -O opencv_contrib.zip https://github.com/opencv/opencv_contrib/archive/4.10.0.zip && \ unzip opencv.zip && unzip opencv_contrib.zip && \ mkdir -p build && cd build && \ - cmake -DOPENCV_EXTRA_MODULES_PATH=../opencv_contrib-4.2.0/modules ../opencv-4.2.0 && \ + cmake -DOPENCV_EXTRA_MODULES_PATH=../opencv_contrib-4.10.0/modules ../opencv-4.10.0 && \ cmake --build . --target install -- -j4 && \ cd /home && rm opencv.zip && rm opencv_contrib.zip && \ - rm -rf opencv-4.2.0 && rm -rf opencv_contrib-4.2.0 && rm -rf build && \ + rm -rf opencv-4.10.0 && rm -rf opencv_contrib-4.10.0 && rm -rf build && \ rm -rf /var/lib/apt/lists/* #------------------------------ # @@ -49,8 +49,7 @@ RUN git clone --branch 2.2.0 --single-branch https://github.com/ceres-solver/cer # Install python requirements for python_utils scripts RUN --mount=type=bind,source=python_utils/requirements_prod.txt,target=/tmp/requirements.txt \ - apt update && apt install -y libgl1 && \ - python -m pip install --requirement /tmp/requirements.txt && \ + python -m pip install --requirement /tmp/requirements.txt --break-system-packages && \ rm -rf /var/lib/apt/lists/* FROM prod as dev @@ -75,5 +74,5 @@ RUN apt update && apt install -y cppcheck clang-tidy valgrind lcov && \ # Install python requirements for python_utils scripts RUN --mount=type=bind,source=python_utils/requirements_dev.txt,target=/tmp/requirements.txt \ - python -m pip install --requirement /tmp/requirements.txt && \ + python -m pip install --requirement /tmp/requirements.txt --break-system-packages && \ rm -rf /var/lib/apt/lists/* \ No newline at end of file diff --git a/python_utils/requirements_dev.txt b/python_utils/requirements_dev.txt index 2f2858b1..b5cb3329 100644 --- a/python_utils/requirements_dev.txt +++ b/python_utils/requirements_dev.txt @@ -1,4 +1,4 @@ isort==5.13.2 -black==24.4.2 -mypy==1.10.0 -pylint==3.2.2 \ No newline at end of file +black==24.8.0 +mypy==1.11.2 +pylint==3.2.6 \ No newline at end of file diff --git a/python_utils/requirements_prod.txt b/python_utils/requirements_prod.txt index 158559c4..4489ff32 100755 --- a/python_utils/requirements_prod.txt +++ b/python_utils/requirements_prod.txt @@ -1,3 +1,3 @@ -numpy==1.24.4 -matplotlib==3.7.5 -opencv-python==4.9.0.80 +numpy==2.1.0 +matplotlib==3.9.2 +opencv-python==4.10.0.84 \ No newline at end of file