diff --git a/Dockerfile b/Dockerfile index a33eafe..df9133a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -7,8 +7,9 @@ FROM opensuse/tumbleweed:latest LABEL maintainer="code@yanwk.fun" -# Note: GCC for InsightFace, -# FFmpeg for video (pip[imageio-ffmpeg] will use system FFmpeg instead of bundled) +# Note: GCC for InsightFace; +# FFmpeg for video (pip[imageio-ffmpeg] will use system FFmpeg instead of bundled). +# Note: CMake may use different version of Python. Using 'update-alternatives' to ensure default version. RUN --mount=type=cache,target=/var/cache/zypp \ set -eu \ && zypper addrepo --check --refresh --priority 90 \ @@ -16,14 +17,15 @@ RUN --mount=type=cache,target=/var/cache/zypp \ && zypper --gpg-auto-import-keys \ install --no-confirm \ python311 python311-pip python311-wheel python311-setuptools \ - python311-devel python311-Cython gcc-c++ cmake \ + python311-devel python311-Cython gcc-c++ python311-py-build-cmake \ python311-numpy python311-opencv \ python311-ffmpeg-python ffmpeg x264 x265 \ python311-dbm \ google-noto-sans-fonts google-noto-sans-cjk-fonts google-noto-coloremoji-fonts \ shadow git aria2 \ Mesa-libGL1 libgthread-2_0-0 \ - && rm /usr/lib64/python3.11/EXTERNALLY-MANAGED + && rm /usr/lib64/python3.11/EXTERNALLY-MANAGED \ + && update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.11 100 RUN --mount=type=cache,target=/root/.cache/pip \ pip install --break-system-packages \ diff --git a/megapak/Dockerfile b/megapak/Dockerfile index 091e635..ea258bf 100644 --- a/megapak/Dockerfile +++ b/megapak/Dockerfile @@ -62,6 +62,7 @@ python311-pip \ python311-wheel \ python311-setuptools \ python311-Cython \ +python311-py-build-cmake \ python311-aiohttp \ python311-dbm \ python311-ffmpeg-python \ @@ -88,7 +89,6 @@ python311-tqdm \ Mesa-libGL1 \ libgthread-2_0-0 \ make \ -cmake \ ninja \ git \ aria2 \ @@ -103,7 +103,8 @@ x265 \ google-noto-sans-fonts \ google-noto-sans-cjk-fonts \ google-noto-coloremoji-fonts \ - && rm /usr/lib64/python3.11/EXTERNALLY-MANAGED + && rm /usr/lib64/python3.11/EXTERNALLY-MANAGED \ + && update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.11 100 ################################################################################ # GCC 12 diff --git a/rocm/Dockerfile b/rocm/Dockerfile index 3cd8c4f..e039058 100644 --- a/rocm/Dockerfile +++ b/rocm/Dockerfile @@ -8,9 +8,10 @@ FROM opensuse/tumbleweed:latest LABEL maintainer="code@yanwk.fun" -# Note: GCC for InsightFace, -# FFmpeg for video (pip[imageio-ffmpeg] will use system FFmpeg instead of bundled), -# 'half' for ORT on ROCm +# Note: GCC for InsightFace; +# FFmpeg for video (pip[imageio-ffmpeg] will use system FFmpeg instead of bundled); +# 'half' for ORT on ROCm. +# Note: CMake may use different version of Python. Using 'update-alternatives' to ensure default version. RUN --mount=type=cache,target=/var/cache/zypp \ set -eu \ && zypper addrepo --check --refresh --priority 90 \ @@ -18,7 +19,7 @@ RUN --mount=type=cache,target=/var/cache/zypp \ && zypper --gpg-auto-import-keys \ install --no-confirm \ python310 python310-pip python310-wheel python310-setuptools \ - python310-devel python310-Cython gcc-c++ cmake \ + python310-devel python310-Cython gcc-c++ python310-py-build-cmake \ python310-numpy python310-opencv \ python310-ffmpeg-python ffmpeg x264 x265 \ python310-dbm \ @@ -26,7 +27,8 @@ RUN --mount=type=cache,target=/var/cache/zypp \ google-noto-sans-fonts google-noto-sans-cjk-fonts google-noto-coloremoji-fonts \ shadow git aria2 \ Mesa-libGL1 libgthread-2_0-0 \ - && rm -f /usr/lib64/python3.10/EXTERNALLY-MANAGED + && rm -f /usr/lib64/python3.10/EXTERNALLY-MANAGED \ + && update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.10 10 RUN --mount=type=cache,target=/root/.cache/pip \ pip install --break-system-packages \ @@ -84,9 +86,6 @@ RUN --mount=type=cache,target=/root/.cache/pip \ mediapipe \ && pip list -# Everything is built with Python 3.10 but SuSE default is now 3.11. Switch back -RUN update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.10 10 - RUN du -ah /root \ && rm -rf /root/* /root/.*