Skip to content

Commit

Permalink
Update Dockerfile to install OpenCV v4.10.0
Browse files Browse the repository at this point in the history
  • Loading branch information
BAILOOL committed Nov 11, 2024
1 parent 0f09cdd commit 9c9cdc8
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 14 deletions.
15 changes: 7 additions & 8 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -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 && \
Expand All @@ -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/*

#------------------------------ #
Expand All @@ -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
Expand All @@ -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/*
6 changes: 3 additions & 3 deletions python_utils/requirements_dev.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
isort==5.13.2
black==24.4.2
mypy==1.10.0
pylint==3.2.2
black==24.8.0
mypy==1.11.2
pylint==3.2.6
6 changes: 3 additions & 3 deletions python_utils/requirements_prod.txt
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 9c9cdc8

Please sign in to comment.