From cb45f61fc7f8fdb1c0785d0b3fd57e9e43c5487f Mon Sep 17 00:00:00 2001 From: Jirka Date: Thu, 22 Dec 2022 16:06:00 +0100 Subject: [PATCH 01/20] ubuntu 22.04 --- .github/workflows/docker-builds.yml | 7 ++++++- cpu/Dockerfile | 4 +++- gpu/Dockerfile | 3 ++- 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/.github/workflows/docker-builds.yml b/.github/workflows/docker-builds.yml index 547e3a9..dc7071b 100644 --- a/.github/workflows/docker-builds.yml +++ b/.github/workflows/docker-builds.yml @@ -17,9 +17,13 @@ jobs: strategy: fail-fast: false matrix: - python_version: ["2.7", "3.6", "3.7", "3.8", "3.9", "3.10", "3.11"] + ubuntu_version: ["22.04"] + python_version: ["3.6", "3.7", "3.8", "3.9", "3.10", "3.11"] opencv_version: ["4.7.0"] device: ["cpu", "gpu"] + include: + - {ubuntu_version: "20.04", python_version: "2.7", opencv_version: "4.6.0", device: "cpu"} + - {ubuntu_version: "20.04", python_version: "2.7", opencv_version: "4.6.0", device: "gpu"} steps: - name: Checkout uses: actions/checkout@v2 @@ -36,6 +40,7 @@ jobs: # https://github.com/docker/build-push-action#cache-to-registry with: build-args: | + UBUNTU_VERSION=${{ matrix.ubuntu_version }} PYTHON_VERSION=${{ matrix.python_version }} OPENCV_VERSION=${{ matrix.opencv_version }} file: ${{ matrix.device }}/Dockerfile diff --git a/cpu/Dockerfile b/cpu/Dockerfile index e6e447a..67e19c4 100644 --- a/cpu/Dockerfile +++ b/cpu/Dockerfile @@ -1,7 +1,9 @@ # https://www.learnopencv.com/install-opencv3-on-ubuntu/ # https://www.osradar.com/how-to-install-opencv-on-ubuntu-20-04/ -FROM ubuntu:20.04 +ARG UBUNTU_VERSION=20.04 + +FROM ubuntu:${UBUNTU_VERSION} LABEL maintainer="https://github.com/Borda" diff --git a/gpu/Dockerfile b/gpu/Dockerfile index b08d3c4..51ff1f5 100644 --- a/gpu/Dockerfile +++ b/gpu/Dockerfile @@ -6,8 +6,9 @@ # CALL: docker image build -t python-opencv-ffmpeg:py36 -f cpu/Dockerfile --build-arg PYTHON_VERSION=3.6 . ARG CUDA_VERSION=11.4.0 +ARG UBUNTU_VERSION=20.04 -FROM nvidia/cuda:${CUDA_VERSION}-devel-ubuntu20.04 +FROM nvidia/cuda:${CUDA_VERSION}-devel-ubuntu${UBUNTU_VERSION} LABEL maintainer="https://github.com/Borda" From 8da48d35174fde9d08cef985d6801de4bcc7d1c2 Mon Sep 17 00:00:00 2001 From: Jirka Date: Thu, 22 Dec 2022 16:26:37 +0100 Subject: [PATCH 02/20] rm --- cpu/Dockerfile | 7 +++---- gpu/Dockerfile | 7 +++---- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/cpu/Dockerfile b/cpu/Dockerfile index 67e19c4..3cc80c6 100644 --- a/cpu/Dockerfile +++ b/cpu/Dockerfile @@ -27,8 +27,8 @@ RUN \ python${PYTHON_VERSION} \ python${PYTHON_VERSION}-dev \ $( [ ${PYTHON_VERSION%%.*} -ge 3 ] && echo "python${PYTHON_VERSION}-distutils" ) \ - wget \ - && \ + wget && \ + rm -rf /var/lib/apt/lists/* && \ # Set the default python and install PIP packages update-alternatives --install /usr/bin/python${PYTHON_VERSION%%.*} python${PYTHON_VERSION%%.*} /usr/bin/python${PYTHON_VERSION} 1 && \ @@ -43,8 +43,7 @@ RUN \ wget https://bootstrap.pypa.io/get-pip.py --progress=bar:force:noscroll --no-check-certificate ; \ fi && \ python${PYTHON_VERSION} get-pip.py && \ - rm get-pip.py && \ - rm -rf /var/lib/apt/lists/* + rm get-pip.py ENV PYTHONPATH="/usr/lib/python${PYTHON_VERSION}/site-packages:/usr/local/lib/python${PYTHON_VERSION}/site-packages" diff --git a/gpu/Dockerfile b/gpu/Dockerfile index 51ff1f5..09c2465 100644 --- a/gpu/Dockerfile +++ b/gpu/Dockerfile @@ -34,8 +34,8 @@ RUN \ python${PYTHON_VERSION} \ python${PYTHON_VERSION}-dev \ $( [ ${PYTHON_VERSION%%.*} -ge 3 ] && echo "python${PYTHON_VERSION}-distutils" ) \ - wget \ - && \ + wget && \ + rm -rf /var/lib/apt/lists/* && \ # Set the default python and install PIP packages update-alternatives --install /usr/bin/python${PYTHON_VERSION%%.*} python${PYTHON_VERSION%%.*} /usr/bin/python${PYTHON_VERSION} 1 && \ @@ -50,8 +50,7 @@ RUN \ wget https://bootstrap.pypa.io/get-pip.py --progress=bar:force:noscroll --no-check-certificate ; \ fi && \ python${PYTHON_VERSION} get-pip.py && \ - rm get-pip.py && \ - rm -rf /var/lib/apt/lists/* + rm get-pip.py ENV PYTHONPATH="/usr/lib/python${PYTHON_VERSION}/site-packages:/usr/local/lib/python${PYTHON_VERSION}/site-packages" From 6598cd5698f19eaaeb87cd8f2f9f085af87dd1ca Mon Sep 17 00:00:00 2001 From: Jirka Date: Thu, 22 Dec 2022 16:30:27 +0100 Subject: [PATCH 03/20] cuda --- gpu/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gpu/Dockerfile b/gpu/Dockerfile index 09c2465..dcab0be 100644 --- a/gpu/Dockerfile +++ b/gpu/Dockerfile @@ -5,7 +5,7 @@ # CALL: docker image build -t python-opencv-ffmpeg:py36 -f cpu/Dockerfile --build-arg PYTHON_VERSION=3.6 . -ARG CUDA_VERSION=11.4.0 +ARG CUDA_VERSION=11.8.0 ARG UBUNTU_VERSION=20.04 FROM nvidia/cuda:${CUDA_VERSION}-devel-ubuntu${UBUNTU_VERSION} From e3d97a437db28daf6a0119ff555bababcf2fe696 Mon Sep 17 00:00:00 2001 From: Jirka Date: Sat, 24 Dec 2022 03:55:50 +0100 Subject: [PATCH 04/20] deadsnakes --- cpu/Dockerfile | 4 +++- gpu/Dockerfile | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/cpu/Dockerfile b/cpu/Dockerfile index 3cc80c6..a51a094 100644 --- a/cpu/Dockerfile +++ b/cpu/Dockerfile @@ -20,7 +20,9 @@ RUN \ # add sources for older pythons apt-get update --fix-missing && \ apt-get install -y --no-install-recommends software-properties-common && \ - add-apt-repository ppa:deadsnakes/ppa && \ + if [[ "$PYTHON_VERSION" == "2.7" || "$PYTHON_VERSION" == "3.6" ]]; then \ + add-apt-repository ppa:deadsnakes/ppa ; \ + fi && \ apt-add-repository universe && \ apt-get -y update -qq --fix-missing && \ apt-get -y install --no-install-recommends \ diff --git a/gpu/Dockerfile b/gpu/Dockerfile index dcab0be..6e5c204 100644 --- a/gpu/Dockerfile +++ b/gpu/Dockerfile @@ -27,7 +27,9 @@ RUN \ # add sources for older pythons apt-get update -qq --fix-missing && \ apt-get install -y --no-install-recommends software-properties-common && \ - add-apt-repository ppa:deadsnakes/ppa && \ + if [[ "$PYTHON_VERSION" == "2.7" || "$PYTHON_VERSION" == "3.6" ]]; then \ + add-apt-repository ppa:deadsnakes/ppa ; \ + fi && \ apt-add-repository universe && \ apt-get -y update -qq --fix-missing && \ apt-get -y install --no-install-recommends \ From 85d1164033f930af532ad0cf389f589b402a14a9 Mon Sep 17 00:00:00 2001 From: Jirka Date: Sat, 24 Dec 2022 04:01:08 +0100 Subject: [PATCH 05/20] move 3.6 -> 20.04 --- .github/workflows/docker-builds.yml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/docker-builds.yml b/.github/workflows/docker-builds.yml index dc7071b..6ba9f76 100644 --- a/.github/workflows/docker-builds.yml +++ b/.github/workflows/docker-builds.yml @@ -18,12 +18,14 @@ jobs: fail-fast: false matrix: ubuntu_version: ["22.04"] - python_version: ["3.6", "3.7", "3.8", "3.9", "3.10", "3.11"] + python_version: ["3.7", "3.8", "3.9", "3.10", "3.11"] opencv_version: ["4.7.0"] device: ["cpu", "gpu"] include: - - {ubuntu_version: "20.04", python_version: "2.7", opencv_version: "4.6.0", device: "cpu"} - - {ubuntu_version: "20.04", python_version: "2.7", opencv_version: "4.6.0", device: "gpu"} + - {ubuntu_version: "20.04", python_version: "2.7", opencv_version: "4.7.0", device: "cpu"} + - {ubuntu_version: "20.04", python_version: "2.7", opencv_version: "4.7.0", device: "gpu"} + - {ubuntu_version: "20.04", python_version: "3.6", opencv_version: "4.7.0", device: "cpu"} + - {ubuntu_version: "20.04", python_version: "3.6", opencv_version: "4.7.0", device: "gpu"} steps: - name: Checkout uses: actions/checkout@v2 From 1c977930b54d82d809b04fb928d96439d06fc053 Mon Sep 17 00:00:00 2001 From: Jirka Date: Sat, 24 Dec 2022 06:37:59 +0100 Subject: [PATCH 06/20] default --- cpu/Dockerfile | 6 +++--- gpu/Dockerfile | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/cpu/Dockerfile b/cpu/Dockerfile index a51a094..800ede6 100644 --- a/cpu/Dockerfile +++ b/cpu/Dockerfile @@ -1,7 +1,7 @@ # https://www.learnopencv.com/install-opencv3-on-ubuntu/ # https://www.osradar.com/how-to-install-opencv-on-ubuntu-20-04/ -ARG UBUNTU_VERSION=20.04 +ARG UBUNTU_VERSION=22.04 FROM ubuntu:${UBUNTU_VERSION} @@ -13,8 +13,8 @@ ARG OPENCV_VERSION=4.7.0 # Needed for string substitution SHELL ["/bin/bash", "-c"] # https://techoverflow.net/2019/05/18/how-to-fix-configuring-tzdata-interactive-input-when-building-docker-images/ -ENV DEBIAN_FRONTEND=noninteractive -ENV TZ=Europe/Prague +ENV DEBIAN_FRONTEND=noninteractive \ + TZ=Europe/Prague RUN \ # add sources for older pythons diff --git a/gpu/Dockerfile b/gpu/Dockerfile index 6e5c204..2747bab 100644 --- a/gpu/Dockerfile +++ b/gpu/Dockerfile @@ -6,7 +6,7 @@ # CALL: docker image build -t python-opencv-ffmpeg:py36 -f cpu/Dockerfile --build-arg PYTHON_VERSION=3.6 . ARG CUDA_VERSION=11.8.0 -ARG UBUNTU_VERSION=20.04 +ARG UBUNTU_VERSION=22.04 FROM nvidia/cuda:${CUDA_VERSION}-devel-ubuntu${UBUNTU_VERSION} @@ -18,8 +18,8 @@ ARG OPENCV_VERSION=4.7.0 # Needed for string substitution SHELL ["/bin/bash", "-c"] # https://techoverflow.net/2019/05/18/how-to-fix-configuring-tzdata-interactive-input-when-building-docker-images/ -ENV DEBIAN_FRONTEND=noninteractive -ENV TZ=Europe/Prague +ENV DEBIAN_FRONTEND=noninteractive \ + TZ=Europe/Prague # ENV LD_LIBRARY_PATH /usr/local/${CUDA}/compat:$LD_LIBRARY_PATH From 45b38068e7197c6acb1766b740be1dbeae74fc9d Mon Sep 17 00:00:00 2001 From: Jirka Date: Wed, 1 Feb 2023 13:06:59 +0100 Subject: [PATCH 07/20] deadsnakes --- .github/workflows/docker-builds.yml | 4 +++- cpu/Dockerfile | 4 ++-- gpu/Dockerfile | 4 ++-- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/.github/workflows/docker-builds.yml b/.github/workflows/docker-builds.yml index 6ba9f76..d3a48e3 100644 --- a/.github/workflows/docker-builds.yml +++ b/.github/workflows/docker-builds.yml @@ -18,7 +18,7 @@ jobs: fail-fast: false matrix: ubuntu_version: ["22.04"] - python_version: ["3.7", "3.8", "3.9", "3.10", "3.11"] + python_version: ["3.8", "3.9", "3.10", "3.11"] opencv_version: ["4.7.0"] device: ["cpu", "gpu"] include: @@ -26,6 +26,8 @@ jobs: - {ubuntu_version: "20.04", python_version: "2.7", opencv_version: "4.7.0", device: "gpu"} - {ubuntu_version: "20.04", python_version: "3.6", opencv_version: "4.7.0", device: "cpu"} - {ubuntu_version: "20.04", python_version: "3.6", opencv_version: "4.7.0", device: "gpu"} + - {ubuntu_version: "20.04", python_version: "3.7", opencv_version: "4.7.0", device: "cpu"} + - {ubuntu_version: "20.04", python_version: "3.7", opencv_version: "4.7.0", device: "gpu"} steps: - name: Checkout uses: actions/checkout@v2 diff --git a/cpu/Dockerfile b/cpu/Dockerfile index 800ede6..4883e58 100644 --- a/cpu/Dockerfile +++ b/cpu/Dockerfile @@ -20,7 +20,7 @@ RUN \ # add sources for older pythons apt-get update --fix-missing && \ apt-get install -y --no-install-recommends software-properties-common && \ - if [[ "$PYTHON_VERSION" == "2.7" || "$PYTHON_VERSION" == "3.6" ]]; then \ + if [[ "$PYTHON_VERSION" =~ ^(2.7|3.6|3.7|3.8|3.9)$ ]]; then \ add-apt-repository ppa:deadsnakes/ppa ; \ fi && \ apt-add-repository universe && \ @@ -38,7 +38,7 @@ RUN \ # install python dependencies # sysctl -w net.ipv4.ip_forward=1 ; \ - if [[ "$PYTHON_VERSION" == "2.7" || "$PYTHON_VERSION" == "3.6" ]]; then \ + if [[ "$PYTHON_VERSION" =~ ^(2.7|3.6|3.7|3.8|3.9)$ ]]; then \ wget https://bootstrap.pypa.io/pip/$PYTHON_VERSION/get-pip.py --progress=bar:force:noscroll --no-check-certificate ; \ else \ apt-get -y install --no-install-recommends python${PYTHON_VERSION}-distutils ; \ diff --git a/gpu/Dockerfile b/gpu/Dockerfile index 2747bab..ee87a04 100644 --- a/gpu/Dockerfile +++ b/gpu/Dockerfile @@ -27,7 +27,7 @@ RUN \ # add sources for older pythons apt-get update -qq --fix-missing && \ apt-get install -y --no-install-recommends software-properties-common && \ - if [[ "$PYTHON_VERSION" == "2.7" || "$PYTHON_VERSION" == "3.6" ]]; then \ + if [[ "$PYTHON_VERSION" =~ ^(2.7|3.6|3.7|3.8|3.9)$ ]]; then \ add-apt-repository ppa:deadsnakes/ppa ; \ fi && \ apt-add-repository universe && \ @@ -45,7 +45,7 @@ RUN \ # install python dependencies # sysctl -w net.ipv4.ip_forward=1 ; \ - if [[ "$PYTHON_VERSION" == "2.7" || "$PYTHON_VERSION" == "3.6" ]]; then \ + if [[ "$PYTHON_VERSION" =~ ^(2.7|3.6|3.7|3.8|3.9)$ ]]; then \ wget https://bootstrap.pypa.io/pip/$PYTHON_VERSION/get-pip.py --progress=bar:force:noscroll --no-check-certificate ; \ else \ apt-get -y install --no-install-recommends python${PYTHON_VERSION}-distutils ; \ From 2045153459b59b93f417b2d2b0e90d654f667e87 Mon Sep 17 00:00:00 2001 From: Jirka Date: Thu, 2 Mar 2023 13:11:01 +0100 Subject: [PATCH 08/20] pip url --- cpu/Dockerfile | 6 +++--- gpu/Dockerfile | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/cpu/Dockerfile b/cpu/Dockerfile index 4883e58..2b2909c 100644 --- a/cpu/Dockerfile +++ b/cpu/Dockerfile @@ -39,11 +39,11 @@ RUN \ # install python dependencies # sysctl -w net.ipv4.ip_forward=1 ; \ if [[ "$PYTHON_VERSION" =~ ^(2.7|3.6|3.7|3.8|3.9)$ ]]; then \ - wget https://bootstrap.pypa.io/pip/$PYTHON_VERSION/get-pip.py --progress=bar:force:noscroll --no-check-certificate ; \ + PIP_URL="https://bootstrap.pypa.io/pip/$PYTHON_VERSION" ; \ else \ - apt-get -y install --no-install-recommends python${PYTHON_VERSION}-distutils ; \ - wget https://bootstrap.pypa.io/get-pip.py --progress=bar:force:noscroll --no-check-certificate ; \ + PIP_URL="https://bootstrap.pypa.io" ; \ fi && \ + wget ${PIP_URL}/get-pip.py --progress=bar:force:noscroll --no-check-certificate ; \ python${PYTHON_VERSION} get-pip.py && \ rm get-pip.py diff --git a/gpu/Dockerfile b/gpu/Dockerfile index ee87a04..2894093 100644 --- a/gpu/Dockerfile +++ b/gpu/Dockerfile @@ -46,11 +46,11 @@ RUN \ # install python dependencies # sysctl -w net.ipv4.ip_forward=1 ; \ if [[ "$PYTHON_VERSION" =~ ^(2.7|3.6|3.7|3.8|3.9)$ ]]; then \ - wget https://bootstrap.pypa.io/pip/$PYTHON_VERSION/get-pip.py --progress=bar:force:noscroll --no-check-certificate ; \ + PIP_URL="https://bootstrap.pypa.io/pip/$PYTHON_VERSION" ; \ else \ - apt-get -y install --no-install-recommends python${PYTHON_VERSION}-distutils ; \ - wget https://bootstrap.pypa.io/get-pip.py --progress=bar:force:noscroll --no-check-certificate ; \ + PIP_URL="https://bootstrap.pypa.io" ; \ fi && \ + wget ${PIP_URL}/get-pip.py --progress=bar:force:noscroll --no-check-certificate ; \ python${PYTHON_VERSION} get-pip.py && \ rm get-pip.py From bb65782571281d562e48892f27e862f079c57cdf Mon Sep 17 00:00:00 2001 From: Jirka Date: Wed, 19 Jul 2023 13:37:34 +0200 Subject: [PATCH 09/20] pip --- README.md | 2 +- cpu/Dockerfile | 4 ++-- gpu/Dockerfile | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index a4caf1e..5319b1b 100644 --- a/README.md +++ b/README.md @@ -25,7 +25,7 @@ You can build it on your own, note it takes lots of time, be prepared. ```bash git clone cd docker_python-opencv-ffmpeg -docker image build -t python-opencv-ffmpeg:py3.8 -f gpu/Dockerfile --build-arg PYTHON_VERSION=3.8 . +docker image build -t python-opencv-ffmpeg:py3.9 -f gpu/Dockerfile --build-arg PYTHON_VERSION=3.9 . ``` To build other versions, select different Dockerfile. diff --git a/cpu/Dockerfile b/cpu/Dockerfile index 2b2909c..b6884db 100644 --- a/cpu/Dockerfile +++ b/cpu/Dockerfile @@ -38,12 +38,12 @@ RUN \ # install python dependencies # sysctl -w net.ipv4.ip_forward=1 ; \ - if [[ "$PYTHON_VERSION" =~ ^(2.7|3.6|3.7|3.8|3.9)$ ]]; then \ + if [[ "$PYTHON_VERSION" =~ ^(2.7|3.6)$ ]]; then \ PIP_URL="https://bootstrap.pypa.io/pip/$PYTHON_VERSION" ; \ else \ PIP_URL="https://bootstrap.pypa.io" ; \ fi && \ - wget ${PIP_URL}/get-pip.py --progress=bar:force:noscroll --no-check-certificate ; \ + wget ${PIP_URL}/get-pip.py --progress=bar:force:noscroll --no-check-certificate && \ python${PYTHON_VERSION} get-pip.py && \ rm get-pip.py diff --git a/gpu/Dockerfile b/gpu/Dockerfile index 2894093..7158a95 100644 --- a/gpu/Dockerfile +++ b/gpu/Dockerfile @@ -45,12 +45,12 @@ RUN \ # install python dependencies # sysctl -w net.ipv4.ip_forward=1 ; \ - if [[ "$PYTHON_VERSION" =~ ^(2.7|3.6|3.7|3.8|3.9)$ ]]; then \ + if [[ "$PYTHON_VERSION" =~ ^(2.7|3.6)$ ]]; then \ PIP_URL="https://bootstrap.pypa.io/pip/$PYTHON_VERSION" ; \ else \ PIP_URL="https://bootstrap.pypa.io" ; \ fi && \ - wget ${PIP_URL}/get-pip.py --progress=bar:force:noscroll --no-check-certificate ; \ + wget ${PIP_URL}/get-pip.py --progress=bar:force:noscroll --no-check-certificate && \ python${PYTHON_VERSION} get-pip.py && \ rm get-pip.py From acc883a1fc172411ce9833aa68d14f56b349cd1a Mon Sep 17 00:00:00 2001 From: Jirka Date: Wed, 19 Jul 2023 14:11:13 +0200 Subject: [PATCH 10/20] cpu in stages --- README.md | 2 +- cpu/Dockerfile | 72 ++++++++++++++++++++------------------------------ gpu/Dockerfile | 2 +- 3 files changed, 30 insertions(+), 46 deletions(-) diff --git a/README.md b/README.md index 5319b1b..fb2fc21 100644 --- a/README.md +++ b/README.md @@ -25,7 +25,7 @@ You can build it on your own, note it takes lots of time, be prepared. ```bash git clone cd docker_python-opencv-ffmpeg -docker image build -t python-opencv-ffmpeg:py3.9 -f gpu/Dockerfile --build-arg PYTHON_VERSION=3.9 . +docker image build -t python-opencv-ffmpeg:py3.9 -f cpu/Dockerfile --build-arg PYTHON_VERSION=3.9 . ``` To build other versions, select different Dockerfile. diff --git a/cpu/Dockerfile b/cpu/Dockerfile index b6884db..bc0a645 100644 --- a/cpu/Dockerfile +++ b/cpu/Dockerfile @@ -3,7 +3,7 @@ ARG UBUNTU_VERSION=22.04 -FROM ubuntu:${UBUNTU_VERSION} +FROM ubuntu:${UBUNTU_VERSION} AS base LABEL maintainer="https://github.com/Borda" @@ -16,6 +16,9 @@ SHELL ["/bin/bash", "-c"] ENV DEBIAN_FRONTEND=noninteractive \ TZ=Europe/Prague +# ============== BASE IMAGE ===================== +# =============================================== + RUN \ # add sources for older pythons apt-get update --fix-missing && \ @@ -34,20 +37,27 @@ RUN \ # Set the default python and install PIP packages update-alternatives --install /usr/bin/python${PYTHON_VERSION%%.*} python${PYTHON_VERSION%%.*} /usr/bin/python${PYTHON_VERSION} 1 && \ - update-alternatives --install /usr/bin/python python /usr/bin/python${PYTHON_VERSION} 1 && \ + update-alternatives --install /usr/bin/python python /usr/bin/python${PYTHON_VERSION} 1 + +ENV PYTHONPATH="/usr/lib/python${PYTHON_VERSION}/site-packages:/usr/local/lib/python${PYTHON_VERSION}/site-packages" - # install python dependencies +RUN \ # sysctl -w net.ipv4.ip_forward=1 ; \ if [[ "$PYTHON_VERSION" =~ ^(2.7|3.6)$ ]]; then \ PIP_URL="https://bootstrap.pypa.io/pip/$PYTHON_VERSION" ; \ else \ PIP_URL="https://bootstrap.pypa.io" ; \ fi && \ - wget ${PIP_URL}/get-pip.py --progress=bar:force:noscroll --no-check-certificate && \ - python${PYTHON_VERSION} get-pip.py && \ + wget -q "${PIP_URL}/get-pip.py" --no-check-certificate && \ + python get-pip.py && \ rm get-pip.py -ENV PYTHONPATH="/usr/lib/python${PYTHON_VERSION}/site-packages:/usr/local/lib/python${PYTHON_VERSION}/site-packages" + + +# ============ COMPILE OPENCV =================== +# =============================================== + +FROM base AS builder RUN \ # Install all dependencies for OpenCV @@ -94,9 +104,9 @@ RUN \ libsm6 \ libxext6 \ libxrender1 \ - && \ - pip${PYTHON_VERSION} install numpy && \ +RUN \ + pip install numpy && \ # Install OpenCV wget https://github.com/opencv/opencv/archive/${OPENCV_VERSION}.zip -O opencv.zip --progress=bar:force:noscroll --no-check-certificate && \ unzip -q opencv.zip && \ @@ -139,45 +149,19 @@ RUN \ # Build, Test and Install cd /opencv/build && \ - make -j$(nproc) && \ + make -j$(nproc) + +# ============= FINAL IMAGE ===================== +# =============================================== + +FROM base +COPY --from=builder /opencv/build /tmp/opencv/build + +RUN \ + cd /tmp/opencv/build && \ make install && \ ldconfig && \ -# cleaning - apt-get -y remove \ - unzip \ - cmake \ - gfortran \ - apt-utils \ - pkg-config \ - checkinstall \ - build-essential \ - libopenblas-dev \ - liblapack-dev \ - libatlas-base-dev \ - #libgtk-3-dev \ - libavcodec-dev \ - libavformat-dev \ - libavutil-dev \ - libswscale-dev \ - libjpeg8-dev \ - libpng-dev \ - libtiff5-dev \ - libdc1394-22-dev \ - libxine2-dev \ - libv4l-dev \ - libgstreamer1.0-dev \ - libgstreamer-plugins-base1.0-dev \ - libglew-dev \ - libpostproc-dev \ - libeigen3-dev \ - libtbb-dev \ - zlib1g-dev \ - && \ - apt-get autoremove -y && \ - apt-get clean && \ - rm -rf /opencv /opencv_contrib /var/lib/apt/lists/* && \ - # Call default command. ffmpeg -version && \ #ldd `which ffmpeg` && \ diff --git a/gpu/Dockerfile b/gpu/Dockerfile index 7158a95..05ffd67 100644 --- a/gpu/Dockerfile +++ b/gpu/Dockerfile @@ -50,7 +50,7 @@ RUN \ else \ PIP_URL="https://bootstrap.pypa.io" ; \ fi && \ - wget ${PIP_URL}/get-pip.py --progress=bar:force:noscroll --no-check-certificate && \ + wget "${PIP_URL}/get-pip.py" --progress=bar:force:noscroll --no-check-certificate && \ python${PYTHON_VERSION} get-pip.py && \ rm get-pip.py From 4ca0f50c45dcb6c512087ba01ad96002bb449e94 Mon Sep 17 00:00:00 2001 From: Jirka Date: Sat, 2 Sep 2023 01:58:44 +0200 Subject: [PATCH 11/20] ... --- .pre-commit-config.yaml | 5 ----- cpu/Dockerfile | 20 ++++++++------------ 2 files changed, 8 insertions(+), 17 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 1fc2238..af0874c 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -24,8 +24,3 @@ repos: additional_dependencies: - mdformat-gfm - mdformat_frontmatter - - - repo: https://github.com/pryorda/dockerfilelint-precommit-hooks - rev: v0.1.0 - hooks: - - id: dockerfilelint diff --git a/cpu/Dockerfile b/cpu/Dockerfile index f7770a5..f75c742 100644 --- a/cpu/Dockerfile +++ b/cpu/Dockerfile @@ -21,18 +21,16 @@ ENV DEBIAN_FRONTEND=noninteractive \ RUN \ # add sources for older pythons - apt-get update --fix-missing && \ + apt-get update -q --fix-missing && \ apt-get install -y --no-install-recommends software-properties-common && \ - if [[ "$PYTHON_VERSION" =~ ^(2.7|3.6|3.7|3.8|3.9)$ ]]; then \ - add-apt-repository ppa:deadsnakes/ppa ; \ - fi && \ apt-add-repository universe && \ apt-get -y update -qq --fix-missing && \ apt-get -y install --no-install-recommends \ python${PYTHON_VERSION} \ python${PYTHON_VERSION}-dev \ $( [ ${PYTHON_VERSION%%.*} -ge 3 ] && echo "python${PYTHON_VERSION}-distutils" ) \ - wget && \ + wget \ + && \ rm -rf /var/lib/apt/lists/* && \ # Set the default python and install PIP packages @@ -53,7 +51,6 @@ RUN \ rm get-pip.py - # ============ COMPILE OPENCV =================== # =============================================== @@ -103,7 +100,7 @@ RUN \ zlib1g-dev \ libsm6 \ libxext6 \ - libxrender1 \ + libxrender1 RUN \ pip install numpy && \ @@ -115,9 +112,9 @@ RUN \ wget https://github.com/opencv/opencv_contrib/archive/${OPENCV_VERSION}.zip -O opencv_contrib.zip --progress=bar:force:noscroll --no-check-certificate && \ unzip -q opencv_contrib.zip && \ mv /opencv_contrib-${OPENCV_VERSION} /opencv_contrib && \ - rm opencv_contrib.zip && \ + rm opencv_contrib.zip -# Prepare build +RUN \ mkdir /opencv/build && \ cd /opencv/build && \ cmake \ @@ -144,10 +141,9 @@ RUN \ -D WITH_LAPACK=ON \ #-D WITH_HPX=ON \ -D ENABLE_PRECOMPILED_HEADERS=OFF \ - .. \ - && \ + .. -# Build, Test and Install +RUN \ cd /opencv/build && \ make -j$(nproc) From 2a7d9bda65c61b11d62e03c218f9bcb1bba7c918 Mon Sep 17 00:00:00 2001 From: Jirka Date: Mon, 4 Sep 2023 16:21:03 +0200 Subject: [PATCH 12/20] update /revert --- .github/workflows/label-conflicts.yml | 22 ++++++ .pre-commit-config.yaml | 5 ++ cpu/Dockerfile | 97 ++++++++++++++++----------- gpu/Dockerfile | 26 ++++--- 4 files changed, 96 insertions(+), 54 deletions(-) create mode 100644 .github/workflows/label-conflicts.yml diff --git a/.github/workflows/label-conflicts.yml b/.github/workflows/label-conflicts.yml new file mode 100644 index 0000000..28fa5c2 --- /dev/null +++ b/.github/workflows/label-conflicts.yml @@ -0,0 +1,22 @@ +name: Label conflicts + +on: + push: + branches: ["master"] + pull_request_target: + types: ["synchronize", "reopened", "opened"] + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + triage-conflicts: + runs-on: ubuntu-latest + steps: + - uses: mschilde/auto-label-merge-conflicts@8c6faa8a252e35ba5e15703b3d747bf726cdb95c # Oct 25, 2021 + with: + CONFLICT_LABEL_NAME: "has conflicts" + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + MAX_RETRIES: 3 + WAIT_MS: 5000 diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index af0874c..1fc2238 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -24,3 +24,8 @@ repos: additional_dependencies: - mdformat-gfm - mdformat_frontmatter + + - repo: https://github.com/pryorda/dockerfilelint-precommit-hooks + rev: v0.1.0 + hooks: + - id: dockerfilelint diff --git a/cpu/Dockerfile b/cpu/Dockerfile index f75c742..cdce10d 100644 --- a/cpu/Dockerfile +++ b/cpu/Dockerfile @@ -3,7 +3,7 @@ ARG UBUNTU_VERSION=22.04 -FROM ubuntu:${UBUNTU_VERSION} AS base +FROM ubuntu:${UBUNTU_VERSION} LABEL maintainer="https://github.com/Borda" @@ -16,45 +16,39 @@ SHELL ["/bin/bash", "-c"] ENV DEBIAN_FRONTEND=noninteractive \ TZ=Europe/Prague -# ============== BASE IMAGE ===================== -# =============================================== RUN \ # add sources for older pythons apt-get update -q --fix-missing && \ apt-get install -y --no-install-recommends software-properties-common && \ + add-apt-repository ppa:deadsnakes/ppa && \ apt-add-repository universe && \ apt-get -y update -qq --fix-missing && \ apt-get -y install --no-install-recommends \ python${PYTHON_VERSION} \ python${PYTHON_VERSION}-dev \ $( [ ${PYTHON_VERSION%%.*} -ge 3 ] && echo "python${PYTHON_VERSION}-distutils" ) \ + curl \ wget \ && \ - rm -rf /var/lib/apt/lists/* && \ - - # Set the default python and install PIP packages - update-alternatives --install /usr/bin/python${PYTHON_VERSION%%.*} python${PYTHON_VERSION%%.*} /usr/bin/python${PYTHON_VERSION} 1 && \ - update-alternatives --install /usr/bin/python python /usr/bin/python${PYTHON_VERSION} 1 + rm -rf /var/lib/apt/lists/* ENV PYTHONPATH="/usr/lib/python${PYTHON_VERSION}/site-packages:/usr/local/lib/python${PYTHON_VERSION}/site-packages" RUN \ + # Set the default python and install PIP packages + update-alternatives --install /usr/bin/python${PYTHON_VERSION%%.*} python${PYTHON_VERSION%%.*} /usr/bin/python${PYTHON_VERSION} 1 && \ + update-alternatives --install /usr/bin/python python /usr/bin/python${PYTHON_VERSION} 1 && \ + + # install python dependencies # sysctl -w net.ipv4.ip_forward=1 ; \ if [[ "$PYTHON_VERSION" =~ ^(2.7|3.6)$ ]]; then \ PIP_URL="https://bootstrap.pypa.io/pip/$PYTHON_VERSION" ; \ else \ PIP_URL="https://bootstrap.pypa.io" ; \ fi && \ - wget -q "${PIP_URL}/get-pip.py" --no-check-certificate && \ - python get-pip.py && \ - rm get-pip.py - - -# ============ COMPILE OPENCV =================== -# =============================================== - -FROM base AS builder + curl "${PIP_URL}/get-pip.py" | python && \ + rm -rf /var/lib/apt/lists/* RUN \ # Install all dependencies for OpenCV @@ -74,18 +68,13 @@ RUN \ libopenblas-dev \ liblapack-dev \ libatlas-base-dev \ - #libgtk-3-dev \ - #libavcodec58 \ libavcodec-dev \ - #libavformat58 \ libavformat-dev \ libavutil-dev \ - #libswscale5 \ libswscale-dev \ libjpeg8-dev \ libpng-dev \ libtiff5-dev \ - #libdc1394-22 \ libdc1394-22-dev \ libxine2-dev \ libv4l-dev \ @@ -100,10 +89,10 @@ RUN \ zlib1g-dev \ libsm6 \ libxext6 \ - libxrender1 - -RUN \ + libxrender1 \ + && \ pip install numpy && \ + # Install OpenCV wget https://github.com/opencv/opencv/archive/${OPENCV_VERSION}.zip -O opencv.zip --progress=bar:force:noscroll --no-check-certificate && \ unzip -q opencv.zip && \ @@ -112,9 +101,9 @@ RUN \ wget https://github.com/opencv/opencv_contrib/archive/${OPENCV_VERSION}.zip -O opencv_contrib.zip --progress=bar:force:noscroll --no-check-certificate && \ unzip -q opencv_contrib.zip && \ mv /opencv_contrib-${OPENCV_VERSION} /opencv_contrib && \ - rm opencv_contrib.zip + rm opencv_contrib.zip && \ -RUN \ +# Prepare build mkdir /opencv/build && \ cd /opencv/build && \ cmake \ @@ -141,25 +130,53 @@ RUN \ -D WITH_LAPACK=ON \ #-D WITH_HPX=ON \ -D ENABLE_PRECOMPILED_HEADERS=OFF \ - .. + .. \ + && \ -RUN \ +# Build, Test and Install cd /opencv/build && \ - make -j$(nproc) - -# ============= FINAL IMAGE ===================== -# =============================================== - -FROM base -COPY --from=builder /opencv/build /tmp/opencv/build - -RUN \ - cd /tmp/opencv/build && \ + make -j$(nproc) && \ make install && \ ldconfig && \ -# Call default command. +# cleaning + apt-get -y remove \ + unzip \ + cmake \ + gfortran \ + apt-utils \ + pkg-config \ + checkinstall \ + build-essential \ + libopenblas-dev \ + liblapack-dev \ + libatlas-base-dev \ + libavcodec-dev \ + libavformat-dev \ + libavutil-dev \ + libswscale-dev \ + libjpeg8-dev \ + libpng-dev \ + libtiff5-dev \ + libdc1394-22-dev \ + libxine2-dev \ + libv4l-dev \ + libgstreamer1.0-dev \ + libgstreamer-plugins-base1.0-dev \ + libglew-dev \ + libpostproc-dev \ + libeigen3-dev \ + libtbb-dev \ + zlib1g-dev \ + && \ + apt-get autoremove -y && \ + apt-get clean && \ + rm -rf /opencv /opencv_contrib /var/lib/apt/lists/* + +RUN \ + # Call default command. ffmpeg -version && \ #ldd `which ffmpeg` && \ python --version && \ + pip list && \ python -c "import cv2 ; print(cv2.__version__)" diff --git a/gpu/Dockerfile b/gpu/Dockerfile index 56c9dec..73c35c5 100644 --- a/gpu/Dockerfile +++ b/gpu/Dockerfile @@ -36,9 +36,12 @@ RUN \ python${PYTHON_VERSION} \ python${PYTHON_VERSION}-dev \ $( [ ${PYTHON_VERSION%%.*} -ge 3 ] && echo "python${PYTHON_VERSION}-distutils" ) \ - wget && \ - rm -rf /var/lib/apt/lists/* && \ + curl \ + wget \ + && \ + rm -rf /var/lib/apt/lists/* +RUN \ # Set the default python and install PIP packages update-alternatives --install /usr/bin/python${PYTHON_VERSION%%.*} python${PYTHON_VERSION%%.*} /usr/bin/python${PYTHON_VERSION} 1 && \ update-alternatives --install /usr/bin/python python /usr/bin/python${PYTHON_VERSION} 1 && \ @@ -50,9 +53,8 @@ RUN \ else \ PIP_URL="https://bootstrap.pypa.io" ; \ fi && \ - wget "${PIP_URL}/get-pip.py" --progress=bar:force:noscroll --no-check-certificate && \ - python${PYTHON_VERSION} get-pip.py && \ - rm get-pip.py + curl "${PIP_URL}/get-pip.py" | python && \ + rm -rf /var/lib/apt/lists/* ENV PYTHONPATH="/usr/lib/python${PYTHON_VERSION}/site-packages:/usr/local/lib/python${PYTHON_VERSION}/site-packages" @@ -80,18 +82,13 @@ RUN \ libopenblas-dev \ liblapack-dev \ libatlas-base-dev \ - #libgtk-3-dev \ - #libavcodec58 \ libavcodec-dev \ - #libavformat58 \ libavformat-dev \ libavutil-dev \ - #libswscale5 \ libswscale-dev \ libjpeg8-dev \ libpng-dev \ libtiff5-dev \ - #libdc1394-22 \ libdc1394-22-dev \ libxine2-dev \ libv4l-dev \ @@ -108,7 +105,7 @@ RUN \ libxext6 \ libxrender1 \ && \ - pip${PYTHON_VERSION} install numpy && \ + pip install numpy && \ # Install OpenCV wget https://github.com/opencv/opencv/archive/$OPENCV_VERSION.zip -O opencv.zip --progress=bar:force:noscroll && \ @@ -179,7 +176,6 @@ RUN \ libopenblas-dev \ liblapack-dev \ libatlas-base-dev \ - #libgtk-3-dev \ libavcodec-dev \ libavformat-dev \ libavutil-dev \ @@ -200,10 +196,12 @@ RUN \ && \ apt-get autoremove -y && \ apt-get clean && \ - rm -rf /opencv /opencv_contrib /var/lib/apt/lists/* && \ + rm -rf /opencv /opencv_contrib /var/lib/apt/lists/* -# Call default command. +RUN \ + # Call default command. ffmpeg -version && \ #ldd `which ffmpeg` && \ python --version && \ + pip list && \ python -c "import cv2 ; print(cv2.__version__)" From 1cb021a04b6913f533175749906b8bd00093045c Mon Sep 17 00:00:00 2001 From: Jirka Date: Mon, 4 Sep 2023 17:27:13 +0200 Subject: [PATCH 13/20] dead snakes --- cpu/Dockerfile | 4 +++- gpu/Dockerfile | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/cpu/Dockerfile b/cpu/Dockerfile index cdde325..53ce4d8 100644 --- a/cpu/Dockerfile +++ b/cpu/Dockerfile @@ -21,7 +21,9 @@ RUN \ # add sources for older pythons apt-get update -q --fix-missing && \ apt-get install -y --no-install-recommends software-properties-common && \ - add-apt-repository ppa:deadsnakes/ppa && \ + if [[ "$PYTHON_VERSION" =~ ^(2.7|3.6|3.7)$ ]]; then \ + add-apt-repository ppa:deadsnakes/ppa ; \ + fi && \ apt-add-repository universe && \ apt-get -y update -qq --fix-missing && \ apt-get -y install --no-install-recommends \ diff --git a/gpu/Dockerfile b/gpu/Dockerfile index 027ff53..e21b446 100644 --- a/gpu/Dockerfile +++ b/gpu/Dockerfile @@ -27,7 +27,7 @@ RUN \ # add sources for older pythons apt-get update -qq --fix-missing && \ apt-get install -y --no-install-recommends software-properties-common && \ - if [[ "$PYTHON_VERSION" =~ ^(2.7|3.6|3.7|3.8|3.9)$ ]]; then \ + if [[ "$PYTHON_VERSION" =~ ^(2.7|3.6|3.7)$ ]]; then \ add-apt-repository ppa:deadsnakes/ppa ; \ fi && \ apt-add-repository universe && \ From e85a0191dbdecf36d3b950b7f619ff604217ef8c Mon Sep 17 00:00:00 2001 From: Jirka Date: Mon, 4 Sep 2023 18:01:13 +0200 Subject: [PATCH 14/20] ci --- .github/workflows/docker-builds.yml | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/.github/workflows/docker-builds.yml b/.github/workflows/docker-builds.yml index 49cccf5..78cc6fb 100644 --- a/.github/workflows/docker-builds.yml +++ b/.github/workflows/docker-builds.yml @@ -17,17 +17,15 @@ jobs: strategy: fail-fast: false matrix: - ubuntu_version: ["22.04"] - python_version: ["3.8", "3.9", "3.10", "3.11"] + ubuntu_version: ["20.04"] + python_version: ["2.7", "3.6", "3.7", "3.8", "3.9"] opencv_version: ["4.8.0"] device: ["cpu", "gpu"] include: - - {ubuntu_version: "20.04", python_version: "2.7", opencv_version: "4.8.0", device: "cpu"} - - {ubuntu_version: "20.04", python_version: "2.7", opencv_version: "4.8.0", device: "gpu"} - - {ubuntu_version: "20.04", python_version: "3.6", opencv_version: "4.8.0", device: "cpu"} - - {ubuntu_version: "20.04", python_version: "3.6", opencv_version: "4.8.0", device: "gpu"} - - {ubuntu_version: "20.04", python_version: "3.7", opencv_version: "4.8.0", device: "cpu"} - - {ubuntu_version: "20.04", python_version: "3.7", opencv_version: "4.8.0", device: "gpu"} + - {ubuntu_version: "22.04", python_version: "3.10", opencv_version: "4.8.0", device: "cpu"} + - {ubuntu_version: "22.04", python_version: "3.10", opencv_version: "4.8.0", device: "gpu"} + - {ubuntu_version: "22.04", python_version: "3.11", opencv_version: "4.8.0", device: "cpu"} + - {ubuntu_version: "22.04", python_version: "3.11", opencv_version: "4.8.0", device: "gpu"} steps: - name: Checkout uses: actions/checkout@v3 From b9733a8d0a39af5cfcdf4b727beb9b8b4f967192 Mon Sep 17 00:00:00 2001 From: Jirka Date: Mon, 4 Sep 2023 18:23:11 +0200 Subject: [PATCH 15/20] qt5 --- cpu/Dockerfile | 6 +++--- gpu/Dockerfile | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/cpu/Dockerfile b/cpu/Dockerfile index 53ce4d8..ec0d371 100644 --- a/cpu/Dockerfile +++ b/cpu/Dockerfile @@ -65,7 +65,7 @@ RUN \ apt-utils \ pkg-config \ checkinstall \ - qt5-default \ + qtbase5-dev qt5-qmake \ build-essential \ libopenblas-base \ libopenblas-dev \ @@ -78,7 +78,7 @@ RUN \ libjpeg8-dev \ libpng-dev \ libtiff5-dev \ - libdc1394-22-dev \ + libdc1394-dev \ libxine2-dev \ libv4l-dev \ libgstreamer1.0 \ @@ -161,7 +161,7 @@ RUN \ libjpeg8-dev \ libpng-dev \ libtiff5-dev \ - libdc1394-22-dev \ + libdc1394-dev \ libxine2-dev \ libv4l-dev \ libgstreamer1.0-dev \ diff --git a/gpu/Dockerfile b/gpu/Dockerfile index e21b446..dd4a7f0 100644 --- a/gpu/Dockerfile +++ b/gpu/Dockerfile @@ -77,7 +77,7 @@ RUN \ apt-utils \ pkg-config \ checkinstall \ - qt5-default \ + qtbase5-dev qt5-qmake \ build-essential \ libopenblas-base \ libopenblas-dev \ @@ -90,7 +90,7 @@ RUN \ libjpeg8-dev \ libpng-dev \ libtiff5-dev \ - libdc1394-22-dev \ + libdc1394-dev \ libxine2-dev \ libv4l-dev \ libgstreamer1.0 \ @@ -184,7 +184,7 @@ RUN \ libjpeg8-dev \ libpng-dev \ libtiff5-dev \ - libdc1394-22-dev \ + libdc1394-dev \ libxine2-dev \ libv4l-dev \ libgstreamer1.0-dev \ From 29e3f6bf888a78cd165437d75b2967a9ea852ff7 Mon Sep 17 00:00:00 2001 From: Jirka Date: Tue, 5 Sep 2023 00:28:57 +0200 Subject: [PATCH 16/20] libdc1394 --- cpu/Dockerfile | 1 + gpu/Dockerfile | 1 + 2 files changed, 2 insertions(+) diff --git a/cpu/Dockerfile b/cpu/Dockerfile index ec0d371..ce1a44b 100644 --- a/cpu/Dockerfile +++ b/cpu/Dockerfile @@ -78,6 +78,7 @@ RUN \ libjpeg8-dev \ libpng-dev \ libtiff5-dev \ + libdc1394 \ libdc1394-dev \ libxine2-dev \ libv4l-dev \ diff --git a/gpu/Dockerfile b/gpu/Dockerfile index dd4a7f0..cb92699 100644 --- a/gpu/Dockerfile +++ b/gpu/Dockerfile @@ -90,6 +90,7 @@ RUN \ libjpeg8-dev \ libpng-dev \ libtiff5-dev \ + libdc1394 \ libdc1394-dev \ libxine2-dev \ libv4l-dev \ From 44e4a1d06fb90dae754165035d211af2100bf62d Mon Sep 17 00:00:00 2001 From: Jirka Date: Thu, 28 Sep 2023 09:18:47 +0200 Subject: [PATCH 17/20] drop 1394 --- cpu/Dockerfile | 3 --- gpu/Dockerfile | 3 --- 2 files changed, 6 deletions(-) diff --git a/cpu/Dockerfile b/cpu/Dockerfile index ce1a44b..8fb9851 100644 --- a/cpu/Dockerfile +++ b/cpu/Dockerfile @@ -78,8 +78,6 @@ RUN \ libjpeg8-dev \ libpng-dev \ libtiff5-dev \ - libdc1394 \ - libdc1394-dev \ libxine2-dev \ libv4l-dev \ libgstreamer1.0 \ @@ -162,7 +160,6 @@ RUN \ libjpeg8-dev \ libpng-dev \ libtiff5-dev \ - libdc1394-dev \ libxine2-dev \ libv4l-dev \ libgstreamer1.0-dev \ diff --git a/gpu/Dockerfile b/gpu/Dockerfile index cb92699..6d11903 100644 --- a/gpu/Dockerfile +++ b/gpu/Dockerfile @@ -90,8 +90,6 @@ RUN \ libjpeg8-dev \ libpng-dev \ libtiff5-dev \ - libdc1394 \ - libdc1394-dev \ libxine2-dev \ libv4l-dev \ libgstreamer1.0 \ @@ -185,7 +183,6 @@ RUN \ libjpeg8-dev \ libpng-dev \ libtiff5-dev \ - libdc1394-dev \ libxine2-dev \ libv4l-dev \ libgstreamer1.0-dev \ From b8d16540984cbb8a2db5ab8ab0528da53d41f8c9 Mon Sep 17 00:00:00 2001 From: Jirka Date: Thu, 28 Sep 2023 13:43:20 +0200 Subject: [PATCH 18/20] libtbb12 --- cpu/Dockerfile | 2 +- gpu/Dockerfile | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/cpu/Dockerfile b/cpu/Dockerfile index 8fb9851..1b1be8e 100644 --- a/cpu/Dockerfile +++ b/cpu/Dockerfile @@ -60,7 +60,7 @@ RUN \ unzip \ cmake \ ffmpeg \ - libtbb2 \ + libtbb12 \ gfortran \ apt-utils \ pkg-config \ diff --git a/gpu/Dockerfile b/gpu/Dockerfile index 6d11903..4d3f475 100644 --- a/gpu/Dockerfile +++ b/gpu/Dockerfile @@ -72,7 +72,7 @@ RUN \ unzip \ cmake \ ffmpeg \ - libtbb2 \ + libtbb12 \ gfortran \ apt-utils \ pkg-config \ From fa079d9ca6edb668f1d3f5c874118c62f4acd5c1 Mon Sep 17 00:00:00 2001 From: Jirka Date: Thu, 28 Sep 2023 13:55:33 +0200 Subject: [PATCH 19/20] "$UBUNTU_VERSION" = "20.04" --- cpu/Dockerfile | 12 +++++------- gpu/Dockerfile | 8 +++----- 2 files changed, 8 insertions(+), 12 deletions(-) diff --git a/cpu/Dockerfile b/cpu/Dockerfile index 1b1be8e..d24d3b4 100644 --- a/cpu/Dockerfile +++ b/cpu/Dockerfile @@ -33,11 +33,8 @@ RUN \ curl \ wget \ && \ - rm -rf /var/lib/apt/lists/* + rm -rf /var/lib/apt/lists/* && \ -ENV PYTHONPATH="/usr/lib/python${PYTHON_VERSION}/site-packages:/usr/local/lib/python${PYTHON_VERSION}/site-packages" - -RUN \ # Set the default python and install PIP packages update-alternatives --install /usr/bin/python${PYTHON_VERSION%%.*} python${PYTHON_VERSION%%.*} /usr/bin/python${PYTHON_VERSION} 1 && \ update-alternatives --install /usr/bin/python python /usr/bin/python${PYTHON_VERSION} 1 && \ @@ -50,8 +47,9 @@ RUN \ apt-get -y install --no-install-recommends python${PYTHON_VERSION}-distutils ; \ PIP_URL="https://bootstrap.pypa.io/get-pip.py" ; \ fi && \ - curl $PIP_URL | python && \ - rm -rf /var/lib/apt/lists/* + curl $PIP_URL | python + +ENV PYTHONPATH="/usr/lib/python${PYTHON_VERSION}/site-packages:/usr/local/lib/python${PYTHON_VERSION}/site-packages" RUN \ # Install all dependencies for OpenCV @@ -60,7 +58,7 @@ RUN \ unzip \ cmake \ ffmpeg \ - libtbb12 \ + $( [ "$UBUNTU_VERSION" = "20.04" ] && libtbb2 || libtbb12 ) \ gfortran \ apt-utils \ pkg-config \ diff --git a/gpu/Dockerfile b/gpu/Dockerfile index 4d3f475..61a3eaa 100644 --- a/gpu/Dockerfile +++ b/gpu/Dockerfile @@ -39,9 +39,8 @@ RUN \ curl \ wget \ && \ - rm -rf /var/lib/apt/lists/* + rm -rf /var/lib/apt/lists/* && \ -RUN \ # Set the default python and install PIP packages update-alternatives --install /usr/bin/python${PYTHON_VERSION%%.*} python${PYTHON_VERSION%%.*} /usr/bin/python${PYTHON_VERSION} 1 && \ update-alternatives --install /usr/bin/python python /usr/bin/python${PYTHON_VERSION} 1 && \ @@ -54,8 +53,7 @@ RUN \ apt-get -y install --no-install-recommends python${PYTHON_VERSION}-distutils ; \ PIP_URL="https://bootstrap.pypa.io/get-pip.py" ; \ fi && \ - curl $PIP_URL | python && \ - rm -rf /var/lib/apt/lists/* + curl $PIP_URL | python ENV PYTHONPATH="/usr/lib/python${PYTHON_VERSION}/site-packages:/usr/local/lib/python${PYTHON_VERSION}/site-packages" @@ -72,7 +70,7 @@ RUN \ unzip \ cmake \ ffmpeg \ - libtbb12 \ + $( [ "$UBUNTU_VERSION" = "20.04" ] && libtbb2 || libtbb12 ) \ gfortran \ apt-utils \ pkg-config \ From 9e80e2cc04db5b14def649e2b38242ae9fa1a323 Mon Sep 17 00:00:00 2001 From: Jirka Date: Thu, 28 Sep 2023 14:38:17 +0200 Subject: [PATCH 20/20] not uninstall libtbb-dev --- cpu/Dockerfile | 1 - gpu/Dockerfile | 1 - 2 files changed, 2 deletions(-) diff --git a/cpu/Dockerfile b/cpu/Dockerfile index d24d3b4..8cf0b5e 100644 --- a/cpu/Dockerfile +++ b/cpu/Dockerfile @@ -165,7 +165,6 @@ RUN \ libglew-dev \ libpostproc-dev \ libeigen3-dev \ - libtbb-dev \ zlib1g-dev \ && \ apt-get autoremove -y && \ diff --git a/gpu/Dockerfile b/gpu/Dockerfile index 61a3eaa..57284a1 100644 --- a/gpu/Dockerfile +++ b/gpu/Dockerfile @@ -188,7 +188,6 @@ RUN \ libglew-dev \ libpostproc-dev \ libeigen3-dev \ - libtbb-dev \ zlib1g-dev \ && \ apt-get autoremove -y && \