Skip to content

Commit

Permalink
Redo docker image
Browse files Browse the repository at this point in the history
OpenCV 4.8.1
Python 3.11
  • Loading branch information
HenryLeC committed Jan 5, 2024
1 parent 0081a18 commit 556c3ed
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 12 deletions.
7 changes: 4 additions & 3 deletions Dockerfile-arm
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
ARG PYTHON_VERSION_SHORT=3.12
ARG OPENCV_VERSION=4.7.0
ARG PYTHON_VERSION_SHORT=3.11
ARG OPENCV_VERSION=4.8.1
ARG CPU_CORES=10

# Download qemu-user-static for amd64
Expand All @@ -13,6 +13,8 @@ RUN set -e; \
FROM --platform=linux/arm64/v8 arm64v8/python:${PYTHON_VERSION_SHORT}
COPY --from=x86_64 /usr/bin/qemu-*-static /usr/bin/

LABEL org.opencontainers.image.source="https://github.com/Ninjineers-2383/docker-opencv"

ARG DEBIAN_FRONTEND=noninteractive

# Installing build tools and dependencies.
Expand Down Expand Up @@ -95,7 +97,6 @@ RUN set -e; \
-D BUILD_opencv_python3=ON \
-D BUILD_opencv_python2=OFF \
-D PYTHON_DEFAULT_EXECUTABLE=$(which python${PYTHON_VERSION}) \
-D OPENCV_SKIP_PYTHON_LOADER=ON \
-D OPENCV_PYTHON3_INSTALL_PATH=$(python${PYTHON_VERSION} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())") \
-D PYTHON3_NUMPY_INCLUDE_DIRS=$(python${PYTHON_VERSION} -c "import numpy; print(numpy.get_include())") \
# Ignore all unnecessary stages
Expand Down
14 changes: 7 additions & 7 deletions Dockerfile-x86_64
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
ARG PYTHON_VERSION_SHORT=3.12
ARG OPENCV_VERSION=4.7.0
ARG PYTHON_VERSION_SHORT=3.11
ARG OPENCV_VERSION=4.8.1
ARG CPU_CORES=10

FROM python:${PYTHON_VERSION_SHORT}-bullseye
FROM python:${PYTHON_VERSION_SHORT}-bookworm

LABEL org.opencontainers.image.source="https://github.com/Ninjineers-2383/docker-opencv"

ARG DEBIAN_FRONTEND=noninteractive

Expand All @@ -26,16 +28,14 @@ RUN set -e; \
libswscale-dev \
libgstreamer-plugins-base1.0-dev \
# Optional dependencies
libtbb2 \
libtbb-dev \
libjpeg-dev \
libpng-dev \
libopenexr-dev \
libtiff-dev \
libwebp-dev \
# Video device drivers
libv4l-dev \
libdc1394-22-dev; \
libdc1394-dev; \
# Clear apt cache
rm -rf /var/lib/apt/lists/*

Expand Down Expand Up @@ -86,8 +86,8 @@ RUN set -e; \
-D BUILD_opencv_python3=ON \
-D BUILD_opencv_python2=OFF \
-D PYTHON_DEFAULT_EXECUTABLE=$(which python${PYTHON_VERSION}) \
-D OPENCV_SKIP_PYTHON_LOADER=ON \
-D OPENCV_PYTHON3_INSTALL_PATH=$(python${PYTHON_VERSION} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())") \
-D PYTHON3_NUMPY_INCLUDE_DIRS=$(python${PYTHON_VERSION} -c "import numpy; print(numpy.get_include())") \
# Ignore all unnecessary stages
-D BUILD_opencv_apps=OFF \
-D BUILD_EXAMPLES=OFF \
Expand Down
2 changes: 1 addition & 1 deletion arm.sh
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
docker run --rm --privileged multiarch/qemu-user-static:register --reset
docker build -t ghcr.io/ninjineers-2383/docker-opencv:4.7.0-py3.12-arm -f Dockerfile-arm .
docker build -t ghcr.io/ninjineers-2383/docker-opencv:4.8.1-py3.11-arm -f Dockerfile-arm .
2 changes: 1 addition & 1 deletion x86_64.sh
Original file line number Diff line number Diff line change
@@ -1 +1 @@
docker build -t ghcr.io/ninjineers-2383/docker-opencv:4.7.0-py3.12-x86_64 -f Dockerfile-x86_64 .
docker build -t ghcr.io/ninjineers-2383/docker-opencv:4.8.1-py3.11-x86_64 -f Dockerfile-x86_64 .

0 comments on commit 556c3ed

Please sign in to comment.