From b0548db052852cc75a7489aade9c69e2c6d9a326 Mon Sep 17 00:00:00 2001 From: Jirka Date: Thu, 22 Dec 2022 15:55:25 +0100 Subject: [PATCH 01/25] lint dockerfile --- .pre-commit-config.yaml | 9 +++++++-- cpu/Dockerfile | 3 ++- gpu/Dockerfile | 3 ++- 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index f6a1284..1fc2238 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -6,7 +6,7 @@ ci: repos: - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.1.0 + rev: v4.4.0 hooks: - id: end-of-file-fixer - id: trailing-whitespace @@ -18,9 +18,14 @@ repos: - id: detect-private-key - repo: https://github.com/executablebooks/mdformat - rev: 0.7.14 + rev: 0.7.16 hooks: - id: mdformat 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 38f48ce..98fd927 100644 --- a/cpu/Dockerfile +++ b/cpu/Dockerfile @@ -41,7 +41,8 @@ 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 get-pip.py && \ + rm -rf /var/lib/apt/lists/* 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 50d0704..d2a1ca5 100644 --- a/gpu/Dockerfile +++ b/gpu/Dockerfile @@ -49,7 +49,8 @@ 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 get-pip.py && \ + rm -rf /var/lib/apt/lists/* ENV PYTHONPATH="/usr/lib/python${PYTHON_VERSION}/site-packages:/usr/local/lib/python${PYTHON_VERSION}/site-packages" From 004776deb8a62b85c02f7a22ceca2ce835f59177 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 1 Jan 2023 17:43:24 +0900 Subject: [PATCH 02/25] Bump actions/cache from 3.0.11 to 3.2.2 (#22) Bumps [actions/cache](https://github.com/actions/cache) from 3.0.11 to 3.2.2. - [Release notes](https://github.com/actions/cache/releases) - [Changelog](https://github.com/actions/cache/blob/main/RELEASES.md) - [Commits](https://github.com/actions/cache/compare/v3.0.11...v3.2.2) --- updated-dependencies: - dependency-name: actions/cache dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/code-format.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/code-format.yml b/.github/workflows/code-format.yml index 1242cef..c688de4 100644 --- a/.github/workflows/code-format.yml +++ b/.github/workflows/code-format.yml @@ -16,7 +16,7 @@ jobs: - name: set PY run: echo "PY=$(python -VV | sha256sum | cut -d' ' -f1)" >> $GITHUB_ENV - - uses: actions/cache@v3.0.11 + - uses: actions/cache@v3.2.2 with: path: ~/.cache/pre-commit key: pre-commit|${{ env.PY }}|${{ hashFiles('.pre-commit-config.yaml') }} From d6ddf03d5f0ac4341f78974953f7f11988afeaf8 Mon Sep 17 00:00:00 2001 From: Jirka Borovec <6035284+Borda@users.noreply.github.com> Date: Tue, 3 Jan 2023 13:14:14 +0900 Subject: [PATCH 03/25] building openCV 4.7 (#23) --- .github/workflows/docker-builds.yml | 2 +- cpu/Dockerfile | 2 +- gpu/Dockerfile | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/docker-builds.yml b/.github/workflows/docker-builds.yml index cf9d1a2..662b7aa 100644 --- a/.github/workflows/docker-builds.yml +++ b/.github/workflows/docker-builds.yml @@ -18,7 +18,7 @@ jobs: fail-fast: false matrix: python_version: ["2.7", "3.6", "3.7", "3.8", "3.9", "3.10", "3.11"] - opencv_version: ["4.6.0"] + opencv_version: ["4.7.0"] device: ["cpu", "gpu"] steps: - name: Checkout diff --git a/cpu/Dockerfile b/cpu/Dockerfile index 98fd927..e6e447a 100644 --- a/cpu/Dockerfile +++ b/cpu/Dockerfile @@ -6,7 +6,7 @@ FROM ubuntu:20.04 LABEL maintainer="https://github.com/Borda" ARG PYTHON_VERSION=3.9 -ARG OPENCV_VERSION=4.6.0 +ARG OPENCV_VERSION=4.7.0 # Needed for string substitution SHELL ["/bin/bash", "-c"] diff --git a/gpu/Dockerfile b/gpu/Dockerfile index d2a1ca5..b08d3c4 100644 --- a/gpu/Dockerfile +++ b/gpu/Dockerfile @@ -12,7 +12,7 @@ FROM nvidia/cuda:${CUDA_VERSION}-devel-ubuntu20.04 LABEL maintainer="https://github.com/Borda" ARG PYTHON_VERSION=3.9 -ARG OPENCV_VERSION=4.6.0 +ARG OPENCV_VERSION=4.7.0 # Needed for string substitution SHELL ["/bin/bash", "-c"] From 570b5732a599bd6fc279b7410e1a2d3d9505e1b8 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 1 Feb 2023 11:07:42 +0100 Subject: [PATCH 04/25] Bump docker/build-push-action from 3 to 4 (#24) Bumps [docker/build-push-action](https://github.com/docker/build-push-action) from 3 to 4. - [Release notes](https://github.com/docker/build-push-action/releases) - [Commits](https://github.com/docker/build-push-action/compare/v3...v4) --- updated-dependencies: - dependency-name: docker/build-push-action dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/docker-builds.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/docker-builds.yml b/.github/workflows/docker-builds.yml index 662b7aa..547e3a9 100644 --- a/.github/workflows/docker-builds.yml +++ b/.github/workflows/docker-builds.yml @@ -32,7 +32,7 @@ jobs: with: username: ${{ secrets.DOCKER_USERNAME }} password: ${{ secrets.DOCKER_PASSWORD }} - - uses: docker/build-push-action@v3 + - uses: docker/build-push-action@v4 # https://github.com/docker/build-push-action#cache-to-registry with: build-args: | From e253bf4337227691188b27e95090dab9cd041f74 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 1 Feb 2023 11:07:57 +0100 Subject: [PATCH 05/25] Bump actions/cache from 3.2.2 to 3.2.4 (#25) Bumps [actions/cache](https://github.com/actions/cache) from 3.2.2 to 3.2.4. - [Release notes](https://github.com/actions/cache/releases) - [Changelog](https://github.com/actions/cache/blob/main/RELEASES.md) - [Commits](https://github.com/actions/cache/compare/v3.2.2...v3.2.4) --- updated-dependencies: - dependency-name: actions/cache dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/code-format.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/code-format.yml b/.github/workflows/code-format.yml index c688de4..6707202 100644 --- a/.github/workflows/code-format.yml +++ b/.github/workflows/code-format.yml @@ -16,7 +16,7 @@ jobs: - name: set PY run: echo "PY=$(python -VV | sha256sum | cut -d' ' -f1)" >> $GITHUB_ENV - - uses: actions/cache@v3.2.2 + - uses: actions/cache@v3.2.4 with: path: ~/.cache/pre-commit key: pre-commit|${{ env.PY }}|${{ hashFiles('.pre-commit-config.yaml') }} From e80eb765db02c3e257a71f92edb4ad94ac2096a9 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 1 Mar 2023 12:15:14 +0100 Subject: [PATCH 06/25] Bump actions/cache from 3.2.4 to 3.2.6 (#26) Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/code-format.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/code-format.yml b/.github/workflows/code-format.yml index 6707202..397bb78 100644 --- a/.github/workflows/code-format.yml +++ b/.github/workflows/code-format.yml @@ -16,7 +16,7 @@ jobs: - name: set PY run: echo "PY=$(python -VV | sha256sum | cut -d' ' -f1)" >> $GITHUB_ENV - - uses: actions/cache@v3.2.4 + - uses: actions/cache@v3.2.6 with: path: ~/.cache/pre-commit key: pre-commit|${{ env.PY }}|${{ hashFiles('.pre-commit-config.yaml') }} From cb26ae96bf7fc8860f38255a8c21ca283c1051ec Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 1 Mar 2023 11:16:35 +0000 Subject: [PATCH 07/25] Bump actions/checkout from 2 to 3 (#27) Bumps [actions/checkout](https://github.com/actions/checkout) from 2 to 3. - [Release notes](https://github.com/actions/checkout/releases) - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md) - [Commits](https://github.com/actions/checkout/compare/v2...v3) --- updated-dependencies: - dependency-name: actions/checkout dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/code-format.yml | 2 +- .github/workflows/docker-builds.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/code-format.yml b/.github/workflows/code-format.yml index 397bb78..2e3f36b 100644 --- a/.github/workflows/code-format.yml +++ b/.github/workflows/code-format.yml @@ -9,7 +9,7 @@ jobs: pre-commit-check: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 with: fetch-depth: 0 - uses: actions/setup-python@v4 diff --git a/.github/workflows/docker-builds.yml b/.github/workflows/docker-builds.yml index 547e3a9..d2a15df 100644 --- a/.github/workflows/docker-builds.yml +++ b/.github/workflows/docker-builds.yml @@ -22,7 +22,7 @@ jobs: device: ["cpu", "gpu"] steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v3 # https://github.com/docker/setup-buildx-action # Set up Docker Buildx - to use cache-from and cache-to argument of buildx command - uses: docker/setup-buildx-action@v2 From 422305334067fb98d5a16506403ddb26da84a60a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 1 Apr 2023 16:29:47 +0200 Subject: [PATCH 08/25] Bump actions/cache from 3.2.6 to 3.3.1 (#29) Bumps [actions/cache](https://github.com/actions/cache) from 3.2.6 to 3.3.1. - [Release notes](https://github.com/actions/cache/releases) - [Changelog](https://github.com/actions/cache/blob/main/RELEASES.md) - [Commits](https://github.com/actions/cache/compare/v3.2.6...v3.3.1) --- updated-dependencies: - dependency-name: actions/cache dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/code-format.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/code-format.yml b/.github/workflows/code-format.yml index 2e3f36b..11cff6c 100644 --- a/.github/workflows/code-format.yml +++ b/.github/workflows/code-format.yml @@ -16,7 +16,7 @@ jobs: - name: set PY run: echo "PY=$(python -VV | sha256sum | cut -d' ' -f1)" >> $GITHUB_ENV - - uses: actions/cache@v3.2.6 + - uses: actions/cache@v3.3.1 with: path: ~/.cache/pre-commit key: pre-commit|${{ env.PY }}|${{ hashFiles('.pre-commit-config.yaml') }} From 47d2739b672d133d7fb73438e7fbd1228ca1a8eb Mon Sep 17 00:00:00 2001 From: Jirka Borovec <6035284+Borda@users.noreply.github.com> Date: Wed, 19 Jul 2023 14:10:42 +0200 Subject: [PATCH 09/25] bump opencv to `4.8.0` (#30) --- .github/workflows/docker-builds.yml | 2 +- README.md | 4 ++-- cpu/Dockerfile | 2 +- gpu/Dockerfile | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/docker-builds.yml b/.github/workflows/docker-builds.yml index d2a15df..e8ac3ea 100644 --- a/.github/workflows/docker-builds.yml +++ b/.github/workflows/docker-builds.yml @@ -18,7 +18,7 @@ jobs: fail-fast: false matrix: python_version: ["2.7", "3.6", "3.7", "3.8", "3.9", "3.10", "3.11"] - opencv_version: ["4.7.0"] + opencv_version: ["4.8.0"] device: ["cpu", "gpu"] steps: - name: Checkout diff --git a/README.md b/README.md index a4caf1e..e5e2fb7 100644 --- a/README.md +++ b/README.md @@ -4,8 +4,8 @@ Repository for clean Dockerfile containing [FFmpeg](https://www.ffmpeg.org/), [O ## Tags -- `:cpu-pyX.y-cvX.y.z` for Python 2.x/3.x, OpenCV 4.6.x, FFmpeg -- `:gpu-pyX.y-cvX.y.z` for Python 2.x/3.x, OpenCV 4.6.x, FFmpeg with CUDA 11.4 support +- `:cpu-pyX.y-cvX.y.z` for Python 2.x/3.x, OpenCV 4.8.x, FFmpeg +- `:gpu-pyX.y-cvX.y.z` for Python 2.x/3.x, OpenCV 4.8.x, FFmpeg with CUDA 11.4 support ## Build diff --git a/cpu/Dockerfile b/cpu/Dockerfile index e6e447a..a2fb33e 100644 --- a/cpu/Dockerfile +++ b/cpu/Dockerfile @@ -6,7 +6,7 @@ FROM ubuntu:20.04 LABEL maintainer="https://github.com/Borda" ARG PYTHON_VERSION=3.9 -ARG OPENCV_VERSION=4.7.0 +ARG OPENCV_VERSION=4.8.0 # Needed for string substitution SHELL ["/bin/bash", "-c"] diff --git a/gpu/Dockerfile b/gpu/Dockerfile index b08d3c4..059674d 100644 --- a/gpu/Dockerfile +++ b/gpu/Dockerfile @@ -5,14 +5,14 @@ # 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.7.1 FROM nvidia/cuda:${CUDA_VERSION}-devel-ubuntu20.04 LABEL maintainer="https://github.com/Borda" ARG PYTHON_VERSION=3.9 -ARG OPENCV_VERSION=4.7.0 +ARG OPENCV_VERSION=4.8.0 # Needed for string substitution SHELL ["/bin/bash", "-c"] From 8dfcafdb1c87a897d1fd5813700b9e8832c72042 Mon Sep 17 00:00:00 2001 From: Jirka Borovec <6035284+Borda@users.noreply.github.com> Date: Sat, 2 Sep 2023 02:31:04 +0200 Subject: [PATCH 10/25] install pip with | (#31) * install pip with | * curl --- cpu/Dockerfile | 8 ++++---- gpu/Dockerfile | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/cpu/Dockerfile b/cpu/Dockerfile index a2fb33e..ea501b0 100644 --- a/cpu/Dockerfile +++ b/cpu/Dockerfile @@ -25,6 +25,7 @@ RUN \ python${PYTHON_VERSION} \ python${PYTHON_VERSION}-dev \ $( [ ${PYTHON_VERSION%%.*} -ge 3 ] && echo "python${PYTHON_VERSION}-distutils" ) \ + curl \ wget \ && \ @@ -35,13 +36,12 @@ RUN \ # install python dependencies # sysctl -w net.ipv4.ip_forward=1 ; \ if [[ "$PYTHON_VERSION" == "2.7" || "$PYTHON_VERSION" == "3.6" ]]; 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/get-pip.py" ; \ 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/get-pip.py" ; \ fi && \ - python${PYTHON_VERSION} get-pip.py && \ - rm get-pip.py && \ + curl $PIP_URL | python && \ rm -rf /var/lib/apt/lists/* 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 059674d..1c929f8 100644 --- a/gpu/Dockerfile +++ b/gpu/Dockerfile @@ -33,6 +33,7 @@ RUN \ python${PYTHON_VERSION} \ python${PYTHON_VERSION}-dev \ $( [ ${PYTHON_VERSION%%.*} -ge 3 ] && echo "python${PYTHON_VERSION}-distutils" ) \ + curl \ wget \ && \ @@ -43,13 +44,12 @@ RUN \ # install python dependencies # sysctl -w net.ipv4.ip_forward=1 ; \ if [[ "$PYTHON_VERSION" == "2.7" || "$PYTHON_VERSION" == "3.6" ]]; 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/get-pip.py" ; \ 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/get-pip.py" ; \ fi && \ - python${PYTHON_VERSION} get-pip.py && \ - rm get-pip.py && \ + curl $PIP_URL | python && \ rm -rf /var/lib/apt/lists/* ENV PYTHONPATH="/usr/lib/python${PYTHON_VERSION}/site-packages:/usr/local/lib/python${PYTHON_VERSION}/site-packages" From b25f4ee91445f7711151d6fa857daaab41d510ca Mon Sep 17 00:00:00 2001 From: Jirka Date: Sun, 3 Sep 2023 00:05:49 +0200 Subject: [PATCH 11/25] ci: add labeling merge conflicts --- .github/workflows/label-conflicts.yml | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) 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 From aaef6e444a1ce88deb0e24f0749c9173d317bd9e Mon Sep 17 00:00:00 2001 From: Jirka Borovec <6035284+Borda@users.noreply.github.com> Date: Thu, 28 Sep 2023 10:01:55 +0200 Subject: [PATCH 12/25] version bump OpenCV 4.8.1 (#33) --- .github/workflows/docker-builds.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/docker-builds.yml b/.github/workflows/docker-builds.yml index e8ac3ea..733df6b 100644 --- a/.github/workflows/docker-builds.yml +++ b/.github/workflows/docker-builds.yml @@ -18,7 +18,7 @@ jobs: fail-fast: false matrix: python_version: ["2.7", "3.6", "3.7", "3.8", "3.9", "3.10", "3.11"] - opencv_version: ["4.8.0"] + opencv_version: ["4.8.1"] device: ["cpu", "gpu"] steps: - name: Checkout From 834f02a36750c0d8a7ce17823fc2e27a7df13964 Mon Sep 17 00:00:00 2001 From: Jirka Borovec <6035284+Borda@users.noreply.github.com> Date: Thu, 28 Sep 2023 16:27:14 +0200 Subject: [PATCH 13/25] bump base OS to `ubuntu:22.04` (#21) --- .github/workflows/docker-builds.yml | 9 ++++++- README.md | 4 +-- cpu/Dockerfile | 40 ++++++++++++++--------------- gpu/Dockerfile | 38 ++++++++++++--------------- 4 files changed, 46 insertions(+), 45 deletions(-) diff --git a/.github/workflows/docker-builds.yml b/.github/workflows/docker-builds.yml index 733df6b..af3d840 100644 --- a/.github/workflows/docker-builds.yml +++ b/.github/workflows/docker-builds.yml @@ -17,9 +17,15 @@ jobs: strategy: fail-fast: false matrix: - python_version: ["2.7", "3.6", "3.7", "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.1"] device: ["cpu", "gpu"] + include: + - {ubuntu_version: "22.04", python_version: "3.10", opencv_version: "4.8.1", device: "cpu"} + - {ubuntu_version: "22.04", python_version: "3.10", opencv_version: "4.8.1", device: "gpu"} + - {ubuntu_version: "22.04", python_version: "3.11", opencv_version: "4.8.1", device: "cpu"} + - {ubuntu_version: "22.04", python_version: "3.11", opencv_version: "4.8.1", device: "gpu"} steps: - name: Checkout uses: actions/checkout@v3 @@ -36,6 +42,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/README.md b/README.md index e5e2fb7..299a16a 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Docker: Python-OpenCV-FFmpeg(-CUDA) -Repository for clean Dockerfile containing [FFmpeg](https://www.ffmpeg.org/), [OpenCV4](https://opencv.org/) and [Python2/3](https://www.python.org/), based on [Ubuntu](https://www.ubuntu.com/) 20.04 LTS. +Repository for clean Dockerfile containing [FFmpeg](https://www.ffmpeg.org/), [OpenCV4](https://opencv.org/) and [Python2/3](https://www.python.org/), based on [Ubuntu](https://www.ubuntu.com/) 22.04 LTS. ## Tags @@ -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 cpu/Dockerfile --build-arg PYTHON_VERSION=3.9 . ``` To build other versions, select different Dockerfile. diff --git a/cpu/Dockerfile b/cpu/Dockerfile index ea501b0..8cf0b5e 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=22.04 + +FROM ubuntu:${UBUNTU_VERSION} LABEL maintainer="https://github.com/Borda" @@ -11,14 +13,17 @@ ARG OPENCV_VERSION=4.8.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 - apt-get update --fix-missing && \ + 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 \ @@ -28,6 +33,7 @@ RUN \ 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 && \ @@ -41,8 +47,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" @@ -53,30 +58,24 @@ RUN \ unzip \ cmake \ ffmpeg \ - libtbb2 \ + $( [ "$UBUNTU_VERSION" = "20.04" ] && libtbb2 || libtbb12 ) \ gfortran \ apt-utils \ pkg-config \ checkinstall \ - qt5-default \ + qtbase5-dev qt5-qmake \ build-essential \ libopenblas-base \ 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 \ libgstreamer1.0 \ @@ -92,7 +91,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 --no-check-certificate && \ @@ -152,7 +151,6 @@ RUN \ libopenblas-dev \ liblapack-dev \ libatlas-base-dev \ - #libgtk-3-dev \ libavcodec-dev \ libavformat-dev \ libavutil-dev \ @@ -160,7 +158,6 @@ RUN \ libjpeg8-dev \ libpng-dev \ libtiff5-dev \ - libdc1394-22-dev \ libxine2-dev \ libv4l-dev \ libgstreamer1.0-dev \ @@ -168,15 +165,16 @@ RUN \ 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/* && \ + 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__)" diff --git a/gpu/Dockerfile b/gpu/Dockerfile index 1c929f8..57284a1 100644 --- a/gpu/Dockerfile +++ b/gpu/Dockerfile @@ -5,9 +5,10 @@ # CALL: docker image build -t python-opencv-ffmpeg:py36 -f cpu/Dockerfile --build-arg PYTHON_VERSION=3.6 . -ARG CUDA_VERSION=11.7.1 +ARG CUDA_VERSION=11.8.0 +ARG UBUNTU_VERSION=22.04 -FROM nvidia/cuda:${CUDA_VERSION}-devel-ubuntu20.04 +FROM nvidia/cuda:${CUDA_VERSION}-devel-ubuntu${UBUNTU_VERSION} LABEL maintainer="https://github.com/Borda" @@ -17,8 +18,8 @@ ARG OPENCV_VERSION=4.8.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 @@ -26,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|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 \ @@ -36,6 +39,7 @@ RUN \ 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 && \ @@ -49,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" @@ -67,30 +70,24 @@ RUN \ unzip \ cmake \ ffmpeg \ - libtbb2 \ + $( [ "$UBUNTU_VERSION" = "20.04" ] && libtbb2 || libtbb12 ) \ gfortran \ apt-utils \ pkg-config \ checkinstall \ - qt5-default \ + qtbase5-dev qt5-qmake \ build-essential \ libopenblas-base \ 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 \ libgstreamer1.0 \ @@ -106,7 +103,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 && \ @@ -177,7 +174,6 @@ RUN \ libopenblas-dev \ liblapack-dev \ libatlas-base-dev \ - #libgtk-3-dev \ libavcodec-dev \ libavformat-dev \ libavutil-dev \ @@ -185,7 +181,6 @@ RUN \ libjpeg8-dev \ libpng-dev \ libtiff5-dev \ - libdc1394-22-dev \ libxine2-dev \ libv4l-dev \ libgstreamer1.0-dev \ @@ -193,15 +188,16 @@ RUN \ 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/* && \ + 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 cd60b8558e0a3863f333e5b290a63b35ceb273d9 Mon Sep 17 00:00:00 2001 From: Jirka Borovec <6035284+Borda@users.noreply.github.com> Date: Thu, 28 Sep 2023 16:33:52 +0200 Subject: [PATCH 14/25] precommit: enable codespell & prettier (#34) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> --- .github/dependabot.yml | 19 ------------------- .github/workflows/docker-builds.yml | 14 +++++++------- .github/workflows/label-conflicts.yml | 2 +- .pre-commit-config.yaml | 14 +++++++++++++- .prettierignore | 2 ++ 5 files changed, 23 insertions(+), 28 deletions(-) create mode 100644 .prettierignore diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 3134295..fa6502c 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -1,25 +1,6 @@ # Basic dependabot.yml file with minimum configuration for two package managers - version: 2 updates: - # Enable version updates for python - - package-ecosystem: "pip" - # Look for a `requirements` in the `root` directory - directory: "/" - # Check for updates once a week - schedule: - interval: "monthly" - # Labels on pull requests for version updates only - labels: - - "CI / tests" - pull-request-branch-name: - # Separate sections of the branch name with a hyphen for example, `dependabot-npm_and_yarn-next_js-acorn-6.4.1` - separator: "-" - # Allow up to 5 open pull requests for pip dependencies - open-pull-requests-limit: 5 - reviewers: - - "borda" - # Enable version updates for GitHub Actions - package-ecosystem: "github-actions" directory: "/" diff --git a/.github/workflows/docker-builds.yml b/.github/workflows/docker-builds.yml index af3d840..70ef6c6 100644 --- a/.github/workflows/docker-builds.yml +++ b/.github/workflows/docker-builds.yml @@ -1,11 +1,11 @@ name: Publish Docker Image # https://www.docker.com/blog/first-docker-github-action-is-here # https://github.com/docker/build-push-action -on: # Trigger the workflow on push or pull request, but only for the master branch +on: # Trigger the workflow on push or pull request, but only for the master branch push: - branches: [ master ] + branches: [master] pull_request: - branches: [ master ] + branches: [master] concurrency: group: ${{ github.workflow }}-${{ github.ref }}-${{ github.head_ref }} @@ -22,10 +22,10 @@ jobs: opencv_version: ["4.8.1"] device: ["cpu", "gpu"] include: - - {ubuntu_version: "22.04", python_version: "3.10", opencv_version: "4.8.1", device: "cpu"} - - {ubuntu_version: "22.04", python_version: "3.10", opencv_version: "4.8.1", device: "gpu"} - - {ubuntu_version: "22.04", python_version: "3.11", opencv_version: "4.8.1", device: "cpu"} - - {ubuntu_version: "22.04", python_version: "3.11", opencv_version: "4.8.1", device: "gpu"} + - { ubuntu_version: "22.04", python_version: "3.10", opencv_version: "4.8.1", device: "cpu" } + - { ubuntu_version: "22.04", python_version: "3.10", opencv_version: "4.8.1", device: "gpu" } + - { ubuntu_version: "22.04", python_version: "3.11", opencv_version: "4.8.1", device: "cpu" } + - { ubuntu_version: "22.04", python_version: "3.11", opencv_version: "4.8.1", device: "gpu" } steps: - name: Checkout uses: actions/checkout@v3 diff --git a/.github/workflows/label-conflicts.yml b/.github/workflows/label-conflicts.yml index 28fa5c2..f0ce1cf 100644 --- a/.github/workflows/label-conflicts.yml +++ b/.github/workflows/label-conflicts.yml @@ -14,7 +14,7 @@ jobs: triage-conflicts: runs-on: ubuntu-latest steps: - - uses: mschilde/auto-label-merge-conflicts@8c6faa8a252e35ba5e15703b3d747bf726cdb95c # Oct 25, 2021 + - uses: mschilde/auto-label-merge-conflicts@8c6faa8a252e35ba5e15703b3d747bf726cdb95c # Oct 25, 2021 with: CONFLICT_LABEL_NAME: "has conflicts" GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 1fc2238..dd74bca 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,6 +1,6 @@ ci: autofix_prs: true - autoupdate_commit_msg: '[pre-commit.ci] pre-commit suggestions' + autoupdate_commit_msg: "[pre-commit.ci] pre-commit suggestions" autoupdate_schedule: quarterly # submodules: true @@ -17,6 +17,11 @@ repos: - id: check-added-large-files - id: detect-private-key + - repo: https://github.com/codespell-project/codespell + rev: v2.2.5 + hooks: + - id: codespell + - repo: https://github.com/executablebooks/mdformat rev: 0.7.16 hooks: @@ -29,3 +34,10 @@ repos: rev: v0.1.0 hooks: - id: dockerfilelint + + - repo: https://github.com/pre-commit/mirrors-prettier + rev: v3.0.3 + hooks: + - id: prettier + # https://prettier.io/docs/en/options.html#print-width + args: ["--print-width=120"] diff --git a/.prettierignore b/.prettierignore new file mode 100644 index 0000000..c5646f7 --- /dev/null +++ b/.prettierignore @@ -0,0 +1,2 @@ +# Ignore all MD files: +**/*.md From ce5ffe4a3ae44d9d19a16bf70df31ad2ce38997e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 28 Sep 2023 16:35:46 +0200 Subject: [PATCH 15/25] Bump actions/checkout from 3 to 4 (#35) Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/ci_schema.yml | 2 +- .github/workflows/code-format.yml | 2 +- .github/workflows/docker-builds.yml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci_schema.yml b/.github/workflows/ci_schema.yml index 639dd3c..4e7b118 100644 --- a/.github/workflows/ci_schema.yml +++ b/.github/workflows/ci_schema.yml @@ -10,7 +10,7 @@ jobs: timeout-minutes: 10 steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Install pkg run: pip install "check-jsonschema>=0.10" diff --git a/.github/workflows/code-format.yml b/.github/workflows/code-format.yml index 11cff6c..39b00a5 100644 --- a/.github/workflows/code-format.yml +++ b/.github/workflows/code-format.yml @@ -9,7 +9,7 @@ jobs: pre-commit-check: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: fetch-depth: 0 - uses: actions/setup-python@v4 diff --git a/.github/workflows/docker-builds.yml b/.github/workflows/docker-builds.yml index 70ef6c6..772204e 100644 --- a/.github/workflows/docker-builds.yml +++ b/.github/workflows/docker-builds.yml @@ -28,7 +28,7 @@ jobs: - { ubuntu_version: "22.04", python_version: "3.11", opencv_version: "4.8.1", device: "gpu" } steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 # https://github.com/docker/setup-buildx-action # Set up Docker Buildx - to use cache-from and cache-to argument of buildx command - uses: docker/setup-buildx-action@v2 From 2f55153dc50a5d79949f3905fb3b1dd6ec694152 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 28 Sep 2023 15:00:38 +0000 Subject: [PATCH 16/25] Bump docker/setup-buildx-action from 2 to 3 (#36) Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/docker-builds.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/docker-builds.yml b/.github/workflows/docker-builds.yml index 772204e..8ab4b6c 100644 --- a/.github/workflows/docker-builds.yml +++ b/.github/workflows/docker-builds.yml @@ -31,7 +31,7 @@ jobs: uses: actions/checkout@v4 # https://github.com/docker/setup-buildx-action # Set up Docker Buildx - to use cache-from and cache-to argument of buildx command - - uses: docker/setup-buildx-action@v2 + - uses: docker/setup-buildx-action@v3 - name: Login to DockerHub uses: docker/login-action@v2 if: github.ref == 'refs/heads/master' From b64ba122604f5ea3bea6b8945ead03b8624122f8 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 28 Sep 2023 15:08:25 +0000 Subject: [PATCH 17/25] Bump docker/build-push-action from 4 to 5 (#39) Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/docker-builds.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/docker-builds.yml b/.github/workflows/docker-builds.yml index 8ab4b6c..ed3bd8c 100644 --- a/.github/workflows/docker-builds.yml +++ b/.github/workflows/docker-builds.yml @@ -38,7 +38,7 @@ jobs: with: username: ${{ secrets.DOCKER_USERNAME }} password: ${{ secrets.DOCKER_PASSWORD }} - - uses: docker/build-push-action@v4 + - uses: docker/build-push-action@v5 # https://github.com/docker/build-push-action#cache-to-registry with: build-args: | From 3727067e6d5016afa0667e39e77f086c96aef53f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 28 Sep 2023 15:10:54 +0000 Subject: [PATCH 18/25] Bump docker/login-action from 2 to 3 (#37) Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/docker-builds.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/docker-builds.yml b/.github/workflows/docker-builds.yml index ed3bd8c..0d6503a 100644 --- a/.github/workflows/docker-builds.yml +++ b/.github/workflows/docker-builds.yml @@ -33,7 +33,7 @@ jobs: # Set up Docker Buildx - to use cache-from and cache-to argument of buildx command - uses: docker/setup-buildx-action@v3 - name: Login to DockerHub - uses: docker/login-action@v2 + uses: docker/login-action@v3 if: github.ref == 'refs/heads/master' with: username: ${{ secrets.DOCKER_USERNAME }} From b0eb10184679c56a49607d62211bdfe08b43f2d5 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 28 Sep 2023 15:17:01 +0000 Subject: [PATCH 19/25] Bump actions/cache from 3.3.1 to v3 (#38) Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Jirka Borovec <6035284+Borda@users.noreply.github.com> --- .github/workflows/code-format.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/code-format.yml b/.github/workflows/code-format.yml index 39b00a5..4928b09 100644 --- a/.github/workflows/code-format.yml +++ b/.github/workflows/code-format.yml @@ -16,7 +16,7 @@ jobs: - name: set PY run: echo "PY=$(python -VV | sha256sum | cut -d' ' -f1)" >> $GITHUB_ENV - - uses: actions/cache@v3.3.1 + - uses: actions/cache@v3 with: path: ~/.cache/pre-commit key: pre-commit|${{ env.PY }}|${{ hashFiles('.pre-commit-config.yaml') }} From dcc34f6d09706a5b62a0cb69dac0fbc66059c66f Mon Sep 17 00:00:00 2001 From: Jirka Borovec <6035284+Borda@users.noreply.github.com> Date: Sun, 31 Dec 2023 22:36:21 +0100 Subject: [PATCH 20/25] bump: OpenCV `4.9.0` (#41) --- .github/workflows/docker-builds.yml | 10 +++++----- README.md | 4 ++-- cpu/Dockerfile | 2 +- gpu/Dockerfile | 2 +- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/.github/workflows/docker-builds.yml b/.github/workflows/docker-builds.yml index 0d6503a..9272b00 100644 --- a/.github/workflows/docker-builds.yml +++ b/.github/workflows/docker-builds.yml @@ -19,13 +19,13 @@ jobs: matrix: ubuntu_version: ["20.04"] python_version: ["2.7", "3.6", "3.7", "3.8", "3.9"] - opencv_version: ["4.8.1"] + opencv_version: ["4.9.0"] device: ["cpu", "gpu"] include: - - { ubuntu_version: "22.04", python_version: "3.10", opencv_version: "4.8.1", device: "cpu" } - - { ubuntu_version: "22.04", python_version: "3.10", opencv_version: "4.8.1", device: "gpu" } - - { ubuntu_version: "22.04", python_version: "3.11", opencv_version: "4.8.1", device: "cpu" } - - { ubuntu_version: "22.04", python_version: "3.11", opencv_version: "4.8.1", device: "gpu" } + - { ubuntu_version: "22.04", python_version: "3.10", opencv_version: "4.9.0", device: "cpu" } + - { ubuntu_version: "22.04", python_version: "3.10", opencv_version: "4.9.0", device: "gpu" } + - { ubuntu_version: "22.04", python_version: "3.11", opencv_version: "4.9.0", device: "cpu" } + - { ubuntu_version: "22.04", python_version: "3.11", opencv_version: "4.9.0", device: "gpu" } steps: - name: Checkout uses: actions/checkout@v4 diff --git a/README.md b/README.md index 299a16a..cfce837 100644 --- a/README.md +++ b/README.md @@ -4,8 +4,8 @@ Repository for clean Dockerfile containing [FFmpeg](https://www.ffmpeg.org/), [O ## Tags -- `:cpu-pyX.y-cvX.y.z` for Python 2.x/3.x, OpenCV 4.8.x, FFmpeg -- `:gpu-pyX.y-cvX.y.z` for Python 2.x/3.x, OpenCV 4.8.x, FFmpeg with CUDA 11.4 support +- `:cpu-pyX.y-cvX.y.z` for Python 2.x/3.x, OpenCV 4.9.x, FFmpeg +- `:gpu-pyX.y-cvX.y.z` for Python 2.x/3.x, OpenCV 4.9.x, FFmpeg with CUDA 11.4 support ## Build diff --git a/cpu/Dockerfile b/cpu/Dockerfile index 8cf0b5e..2fdc269 100644 --- a/cpu/Dockerfile +++ b/cpu/Dockerfile @@ -8,7 +8,7 @@ FROM ubuntu:${UBUNTU_VERSION} LABEL maintainer="https://github.com/Borda" ARG PYTHON_VERSION=3.9 -ARG OPENCV_VERSION=4.8.0 +ARG OPENCV_VERSION=4.9.0 # Needed for string substitution SHELL ["/bin/bash", "-c"] diff --git a/gpu/Dockerfile b/gpu/Dockerfile index 57284a1..dcb13f5 100644 --- a/gpu/Dockerfile +++ b/gpu/Dockerfile @@ -13,7 +13,7 @@ FROM nvidia/cuda:${CUDA_VERSION}-devel-ubuntu${UBUNTU_VERSION} LABEL maintainer="https://github.com/Borda" ARG PYTHON_VERSION=3.9 -ARG OPENCV_VERSION=4.8.0 +ARG OPENCV_VERSION=4.9.0 # Needed for string substitution SHELL ["/bin/bash", "-c"] From a71c8b66c41d31e990534990788f999a9ddd8401 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 1 Jan 2024 16:25:22 +0100 Subject: [PATCH 21/25] Bump actions/setup-python from 4 to 5 (#44) Bumps [actions/setup-python](https://github.com/actions/setup-python) from 4 to 5. - [Release notes](https://github.com/actions/setup-python/releases) - [Commits](https://github.com/actions/setup-python/compare/v4...v5) --- updated-dependencies: - dependency-name: actions/setup-python dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/code-format.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/code-format.yml b/.github/workflows/code-format.yml index 4928b09..29924e8 100644 --- a/.github/workflows/code-format.yml +++ b/.github/workflows/code-format.yml @@ -12,7 +12,7 @@ jobs: - uses: actions/checkout@v4 with: fetch-depth: 0 - - uses: actions/setup-python@v4 + - uses: actions/setup-python@v5 - name: set PY run: echo "PY=$(python -VV | sha256sum | cut -d' ' -f1)" >> $GITHUB_ENV From 00583c63fa4fc962c91cdf5a133c7a2a67333256 Mon Sep 17 00:00:00 2001 From: Brian Jubelirer Date: Wed, 14 Dec 2022 16:55:22 -0500 Subject: [PATCH 22/25] remove unneeded files, python3 only (#1) --- .github/CODEOWNERS | 6 ----- .github/ISSUE_TEMPLATE/bug_report.md | 29 ----------------------- .github/ISSUE_TEMPLATE/feature_request.md | 23 ------------------ .github/PULL_REQUEST_TEMPLATE.md | 18 -------------- .github/workflows/docker-builds.yml | 6 +++-- README.md | 18 ++++++-------- _config.yml | 1 - 7 files changed, 11 insertions(+), 90 deletions(-) delete mode 100644 .github/CODEOWNERS delete mode 100644 .github/ISSUE_TEMPLATE/bug_report.md delete mode 100644 .github/ISSUE_TEMPLATE/feature_request.md delete mode 100644 .github/PULL_REQUEST_TEMPLATE.md delete mode 100644 _config.yml diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS deleted file mode 100644 index a8687a1..0000000 --- a/.github/CODEOWNERS +++ /dev/null @@ -1,6 +0,0 @@ -# This is a comment. -# Each line is a file pattern followed by one or more owners. - -# These owners will be the default owners for everything in the repo. Unless a later match takes precedence, -# @global-owner1 and @global-owner2 will be requested for review when someone opens a pull request. -* @borda diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md deleted file mode 100644 index 15cdcc8..0000000 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ /dev/null @@ -1,29 +0,0 @@ ---- -name: Bug report -about: Create a report to help us improve -title: '' -labels: bug, help wanted -assignees: '' ---- - -## 🐛 Bug - - - -### To Reproduce - -Steps to reproduce the behavior: - -1. Go to '...' -1. Run '....' -1. See error - - - -### Expected behavior - - - -### Additional context - - diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md deleted file mode 100644 index 36269e3..0000000 --- a/.github/ISSUE_TEMPLATE/feature_request.md +++ /dev/null @@ -1,23 +0,0 @@ ---- -name: Feature request -about: Suggest an idea for this project -title: '' -labels: enhancement, help wanted -assignees: '' ---- - -## 🚀 Feature - - - -### Motivation - - - -### Alternatives - - - -### Additional context - - diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md deleted file mode 100644 index 7642926..0000000 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ /dev/null @@ -1,18 +0,0 @@ -# Before submitting - -- [ ] Was this discussed/approved via a Github issue? (no need for typos and docs improvements) -- [ ] Did you make sure to update the docs? -- [ ] Did you write any new necessary tests? - -## What does this PR do? - -Fixes #(issue). - -## PR review - -Anyone in the community is free to review the PR once the tests have passed. -If we didn't discuss your PR in Github issues there's a high chance it will not be merged. - -## Did you have fun? - -Make sure you had fun coding 🙃 diff --git a/.github/workflows/docker-builds.yml b/.github/workflows/docker-builds.yml index 9272b00..2c1695c 100644 --- a/.github/workflows/docker-builds.yml +++ b/.github/workflows/docker-builds.yml @@ -3,9 +3,11 @@ name: Publish Docker Image # https://github.com/docker/build-push-action on: # Trigger the workflow on push or pull request, but only for the master branch push: - branches: [master] + branches: + - master pull_request: - branches: [master] + branches: + - master concurrency: group: ${{ github.workflow }}-${{ github.ref }}-${{ github.head_ref }} diff --git a/README.md b/README.md index cfce837..11d1b98 100644 --- a/README.md +++ b/README.md @@ -1,22 +1,18 @@ # Docker: Python-OpenCV-FFmpeg(-CUDA) -Repository for clean Dockerfile containing [FFmpeg](https://www.ffmpeg.org/), [OpenCV4](https://opencv.org/) and [Python2/3](https://www.python.org/), based on [Ubuntu](https://www.ubuntu.com/) 22.04 LTS. +Repository for clean Dockerfile containing [FFmpeg](https://www.ffmpeg.org/), [OpenCV4](https://opencv.org/) and [Python3](https://www.python.org/), based on [Ubuntu](https://www.ubuntu.com/) 20.04 LTS. ## Tags -- `:cpu-pyX.y-cvX.y.z` for Python 2.x/3.x, OpenCV 4.9.x, FFmpeg -- `:gpu-pyX.y-cvX.y.z` for Python 2.x/3.x, OpenCV 4.9.x, FFmpeg with CUDA 11.4 support +- `:cpu-pyX.y-cvX.y.z` for Python 3.x, OpenCV 4.9.x, FFmpeg +- `:gpu-pyX.y-cvX.y.z` for Python 3.x, OpenCV 4.9.x, FFmpeg with CUDA 11.4 support ## Build -[![Publish Docker Image](https://github.com/Borda/docker_python-opencv-ffmpeg/workflows/Publish%20Docker%20Image/badge.svg?branch=master&event=push)](https://github.com/Borda/docker_python-opencv-ffmpeg/actions?query=workflow%3A%22Publish+Docker+Image%22) -[![Docker Build Status](https://img.shields.io/docker/cloud/build/borda/docker_python-opencv-ffmpeg)](https://hub.docker.com/r/borda/docker_python-opencv-ffmpeg) -[![DockerHub Pulls](https://img.shields.io/docker/pulls/borda/docker_python-opencv-ffmpeg.svg)](https://hub.docker.com/r/borda/docker_python-opencv-ffmpeg) -[![Docker](https://img.shields.io/docker/automated/borda/docker_python-opencv-ffmpeg)](https://hub.docker.com/r/borda/docker_python-opencv-ffmpeg) - - +[![Publish Docker Image](https://github.com/dzynetech/docker_python-opencv-ffmpeg/workflows/Publish%20Docker%20Image/badge.svg?branch=master&event=push)](https://github.com/dzynetech/docker_python-opencv-ffmpeg/actions?query=workflow%3A%22Publish+Docker+Image%22) +[![Docker Build Status](https://img.shields.io/docker/cloud/build/bjubes/docker_python-opencv-ffmpeg)](https://hub.docker.com/r/bjubes/docker_python-opencv-ffmpeg) +[![DockerHub Pulls](https://img.shields.io/docker/pulls/bjubes/docker_python-opencv-ffmpeg.svg)](https://hub.docker.com/r/bjubes/docker_python-opencv-ffmpeg) +[![Docker](https://img.shields.io/docker/automated/bjubes/docker_python-opencv-ffmpeg)](https://hub.docker.com/r/bjubes/docker_python-opencv-ffmpeg) First you need to install docker on your local computer, see following [tutorial](https://docs.docker.com/install/linux/docker-ce/ubuntu/#set-up-the-repository). Note, for running the docker properly you have be logged as superuser otherwise you will face many partial issues which sometimes does not make much sense. diff --git a/_config.yml b/_config.yml deleted file mode 100644 index 72d781d..0000000 --- a/_config.yml +++ /dev/null @@ -1 +0,0 @@ -theme: jekyll-theme-tactile From 75c9d95327df964d82af96a9992a1089c45e9750 Mon Sep 17 00:00:00 2001 From: Brian Jubelirer Date: Thu, 15 Dec 2022 09:56:00 -0500 Subject: [PATCH 23/25] change docker hub user --- .github/workflows/docker-builds.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/docker-builds.yml b/.github/workflows/docker-builds.yml index 2c1695c..e90421b 100644 --- a/.github/workflows/docker-builds.yml +++ b/.github/workflows/docker-builds.yml @@ -50,5 +50,5 @@ jobs: file: ${{ matrix.device }}/Dockerfile # publish master push: ${{ github.ref == 'refs/heads/master' }} - tags: borda/docker_python-opencv-ffmpeg:${{ matrix.device }}-py${{ matrix.python_version }}-cv${{ matrix.opencv_version }} + tags: bjubes/docker_python-opencv-ffmpeg:${{ matrix.device }}-py${{ matrix.python_version }}-cv${{ matrix.opencv_version }} timeout-minutes: 240 From 01530c866b22aedf1979bd1cdc88676e089a22ef Mon Sep 17 00:00:00 2001 From: Brian Jubelirer Date: Thu, 15 Dec 2022 11:41:48 -0500 Subject: [PATCH 24/25] remove old python pip deps --- cpu/Dockerfile | 13 +++++-------- gpu/Dockerfile | 13 +++++-------- 2 files changed, 10 insertions(+), 16 deletions(-) diff --git a/cpu/Dockerfile b/cpu/Dockerfile index 2fdc269..881574e 100644 --- a/cpu/Dockerfile +++ b/cpu/Dockerfile @@ -5,7 +5,7 @@ ARG UBUNTU_VERSION=22.04 FROM ubuntu:${UBUNTU_VERSION} -LABEL maintainer="https://github.com/Borda" +LABEL maintainer="https://github.com/dzynetech" ARG PYTHON_VERSION=3.9 ARG OPENCV_VERSION=4.9.0 @@ -41,13 +41,10 @@ RUN \ # install python dependencies # sysctl -w net.ipv4.ip_forward=1 ; \ - if [[ "$PYTHON_VERSION" == "2.7" || "$PYTHON_VERSION" == "3.6" ]]; then \ - PIP_URL="https://bootstrap.pypa.io/pip/$PYTHON_VERSION/get-pip.py" ; \ - else \ - 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 + 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 ; \ + python${PYTHON_VERSION} get-pip.py && \ + 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 dcb13f5..17cbf7e 100644 --- a/gpu/Dockerfile +++ b/gpu/Dockerfile @@ -10,7 +10,7 @@ ARG UBUNTU_VERSION=22.04 FROM nvidia/cuda:${CUDA_VERSION}-devel-ubuntu${UBUNTU_VERSION} -LABEL maintainer="https://github.com/Borda" +LABEL maintainer="https://github.com/dzynetech" ARG PYTHON_VERSION=3.9 ARG OPENCV_VERSION=4.9.0 @@ -47,13 +47,10 @@ RUN \ # install python dependencies # sysctl -w net.ipv4.ip_forward=1 ; \ - if [[ "$PYTHON_VERSION" == "2.7" || "$PYTHON_VERSION" == "3.6" ]]; then \ - PIP_URL="https://bootstrap.pypa.io/pip/$PYTHON_VERSION/get-pip.py" ; \ - else \ - 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 + 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 ; \ + python${PYTHON_VERSION} get-pip.py && \ + rm get-pip.py ENV PYTHONPATH="/usr/lib/python${PYTHON_VERSION}/site-packages:/usr/local/lib/python${PYTHON_VERSION}/site-packages" From b2ebe8f8900f2b9f0ccc61344051db4a18899748 Mon Sep 17 00:00:00 2001 From: Brian Jubelirer Date: Wed, 21 Dec 2022 12:02:29 -0500 Subject: [PATCH 25/25] use dzynetech docker user --- .github/workflows/docker-builds.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/docker-builds.yml b/.github/workflows/docker-builds.yml index e90421b..79689a4 100644 --- a/.github/workflows/docker-builds.yml +++ b/.github/workflows/docker-builds.yml @@ -50,5 +50,5 @@ jobs: file: ${{ matrix.device }}/Dockerfile # publish master push: ${{ github.ref == 'refs/heads/master' }} - tags: bjubes/docker_python-opencv-ffmpeg:${{ matrix.device }}-py${{ matrix.python_version }}-cv${{ matrix.opencv_version }} + tags: dzynetech/docker_python-opencv-ffmpeg:${{ matrix.device }}-py${{ matrix.python_version }}-cv${{ matrix.opencv_version }} timeout-minutes: 240