Runner image: use WineHQ wine-staging + embeddable Python (Wine 8.0 too old for Py3.12)

This commit is contained in:
2026-09-13 21:13:30 -04:00
parent c9575817fe
commit a7f90cd5a7
+20 -13
View File
@@ -12,14 +12,17 @@ ENV DEBIAN_FRONTEND=noninteractive \
WINEDLLOVERRIDES="mscoree,mshtml=" \ WINEDLLOVERRIDES="mscoree,mshtml=" \
PYTHON_VERSION=3.12.8 PYTHON_VERSION=3.12.8
# Wine (32-bit + 64-bit: winetricks/regedit needs the 32-bit parts), # WineHQ wine-staging (newer than Debian's 8.0, needed for Python 3.12),
# node + git for JS actions, and build/package tooling. # node + git for JS actions, and build/package tooling.
RUN dpkg --add-architecture i386 \ RUN dpkg --add-architecture i386 \
&& apt-get update \ && apt-get update \
&& apt-get install -y --no-install-recommends \ && apt-get install -y --no-install-recommends ca-certificates curl wget gnupg2 \
ca-certificates curl wget unzip zip \ && mkdir -p /etc/apt/keyrings \
wine wine64 wine32 xvfb xauth cabextract \ && wget -qO- https://dl.winehq.org/wine-builds/winehq.key | gpg --dearmor -o /etc/apt/keyrings/winehq.gpg \
nodejs git \ && echo "deb [signed-by=/etc/apt/keyrings/winehq.gpg] https://dl.winehq.org/wine-builds/debian/ bookworm main" > /etc/apt/sources.list.d/winehq.list \
&& apt-get update \
&& apt-get install -y --install-recommends winehq-staging \
&& apt-get install -y --no-install-recommends unzip zip xvfb xauth cabextract nodejs git \
&& apt-get clean && rm -rf /var/lib/apt/lists/* && apt-get clean && rm -rf /var/lib/apt/lists/*
# winetricks (standalone script; not packaged in Debian main). # winetricks (standalone script; not packaged in Debian main).
@@ -35,20 +38,24 @@ RUN wget -qO /usr/local/bin/act_runner \
# MSVC runtime required by PySide6's Qt DLLs (also initializes the Wine prefix). # MSVC runtime required by PySide6's Qt DLLs (also initializes the Wine prefix).
RUN xvfb-run -a winetricks --unattended vcrun2022 RUN xvfb-run -a winetricks --unattended vcrun2022
# Windows CPython 3.12 (full installer: bundles pip + OpenSSL; needs wine32 for # Windows CPython 3.12 (embeddable zip) + pip.
# the 32-bit installer bootstrap, which is installed above). RUN wget -qO /tmp/pyembed.zip \
RUN wget -qO /tmp/python-installer.exe \ "https://www.python.org/ftp/python/${PYTHON_VERSION}/python-${PYTHON_VERSION}-embed-amd64.zip" \
"https://www.python.org/ftp/python/${PYTHON_VERSION}/python-${PYTHON_VERSION}-amd64.exe" \ && mkdir -p /root/.wine/drive_c/Python312 \
&& xvfb-run -a wine /tmp/python-installer.exe \ && cd /root/.wine/drive_c/Python312 \
/quiet InstallAllUsers=1 PrependPath=1 TargetDir=C:\\Python312 Include_test=0 Include_launcher=0 Shortcuts=0 \ && unzip -q /tmp/pyembed.zip \
&& rm -f /tmp/python-installer.exe \ && rm -f /tmp/pyembed.zip \
&& printf 'python312.zip\n.\nimport site\nLib\\site-packages\n' > python312._pth \
&& wine "C:\\Python312\\python.exe" --version && wine "C:\\Python312\\python.exe" --version
# Convenience wrapper: winpython -> wine C:\Python312\python.exe # Convenience wrapper: winpython -> wine C:\Python312\python.exe
RUN printf '#!/bin/sh\nexec wine "C:\\Python312\\python.exe" "$@"\n' > /usr/local/bin/winpython \ RUN printf '#!/bin/sh\nexec wine "C:\\Python312\\python.exe" "$@"\n' > /usr/local/bin/winpython \
&& chmod +x /usr/local/bin/winpython && chmod +x /usr/local/bin/winpython
# Pre-install the Windows build deps so CI jobs start fast. # Bootstrap pip, then pre-install the Windows build deps so CI jobs start fast.
RUN wget -qO /tmp/get-pip.py https://bootstrap.pypa.io/get-pip.py \
&& wine "C:\\Python312\\python.exe" /tmp/get-pip.py \
&& rm -f /tmp/get-pip.py
COPY requirements-build.txt /tmp/requirements-build.txt COPY requirements-build.txt /tmp/requirements-build.txt
RUN winpython -m pip install --upgrade pip \ RUN winpython -m pip install --upgrade pip \
&& winpython -m pip install -r /tmp/requirements-build.txt \ && winpython -m pip install -r /tmp/requirements-build.txt \