11# Use the Debian testing image as the base
2- FROM debian:latest
2+ FROM debian:testing
33
44# Set the frontend to noninteractive to prevent interactive prompts during installations
55ENV DEBIAN_FRONTEND=noninteractive
66
7- # Define arguments for Wine, Python, and PyInstaller versions
8- ARG WINE_VERSION=winehq-staging
9- ARG PYTHON_VERSION=3.10.1
10-
117# Add i386 architecture support and update package list
128RUN set -x \
139 && dpkg --add-architecture i386 \
10+ && echo 'deb http://deb.debian.org/debian bookworm main' | tee /etc/apt/sources.list.d/bookworm.list\
1411 && apt update -qy && apt clean
1512
1613# Install essential tools and dependencies without unnecessary recommended packages
@@ -20,7 +17,6 @@ RUN apt install --no-install-recommends -qfy\
2017 gpg-agent \
2118 rename \
2219 software-properties-common \
23- tree\
2420 unzip\
2521 wget \
2622 && apt clean
@@ -71,10 +67,25 @@ RUN set -x \
7167 && rename 's/_/\- /g' *.dll \
7268 && cp "$W_TMP" /*.dll "$W_SYSTEM64_DLLS" /
7369
70+
71+ # Set working directory to Wine drive C
72+ WORKDIR "$W_DRIVE_C"
73+
74+ # Download GCC to set up a cross-compiling environment
75+ # MSVCRT 64bit runtime https://winlibs.com/#download-release
76+ ADD https://github.com/brechtsanders/winlibs_mingw/releases/download/14.2.0posix-19.1.1-12.0.0-msvcrt-r2/winlibs-x86_64-posix-seh-gcc-14.2.0-llvm-19.1.1-mingw-w64msvcrt-12.0.0-r2.zip "winlibs.zip"
77+ RUN unzip "winlibs.zip" -d './' \
78+ && ls\
79+ && rm winlibs.zip\
80+ && wine reg add "HKEY_CURRENT_USER\E nvironment" /v PATH /t REG_SZ /d "C:\\ mingw64\b in;%PATH%" /f \
81+ && echo "gcc --version" | wine cmd
82+
83+
7484# Set working directory to Wine drive C
7585WORKDIR "$W_DRIVE_C"
7686
7787# Define the Python FTP repository for MSI installation files
88+ ARG PYTHON_VERSION=3.10.2
7889ARG PY_FTP_REPO=https://www.python.org/ftp/python/$PYTHON_VERSION/amd64
7990
8091# Add all Python MSI files into the container
@@ -89,14 +100,20 @@ ADD ${PY_FTP_REPO}/tools.msi /tmppy/tools.msi
89100# Install each Python MSI file using Wine
90101RUN ls /tmppy \
91102 && for msifile in `echo core dev exe lib path pip tcltk tools`; do \
92- wine msiexec /i "/tmppy/${msifile}.msi" /qb TARGETDIR=C:/python; \
103+ wine msiexec /i "/tmppy/${msifile}.msi" /qb TARGETDIR=C:/python && echo "DONE:${msifile}" ; \
93104 done\
94105 && rm -rf "/tmppy/" \
95106 && chmod -R a+rx "$W_DRIVE_C/python"
96107
97108# Set Python environment variable
98109ENV PYTT="$W_DRIVE_C/python"
99110
111+ # Update PyConfig.h file
112+ COPY ../py_conf_update.sh /py_conf_update.sh
113+ RUN chmod a+rx /py_conf_update.sh\
114+ && /py_conf_update.sh\
115+ && rm /py_conf_update.sh
116+
100117# Add get-pip script for installing pip
101118ADD https://bootstrap.pypa.io/get-pip.py "${PYTT}/get-pip.py"
102119
@@ -108,6 +125,7 @@ RUN echo 'wine '\''C:\python\python.exe'\'' "$@"' > /usr/bin/python \
108125 && echo 'wine ' \' 'C:\p ython\S cripts\p yupdater.exe' \' ' "$@"' > /usr/bin/pyupdater \
109126 && echo 'wine ' \' 'C:\p ython\S cripts\c ython.exe' \' ' "$@"' > /usr/bin/cython \
110127 && echo 'wine ' \' 'C:\p ython\S cripts\c ythonize.exe' \' ' "$@"' > /usr/bin/cythonize \
128+ && wine --version \
111129 && echo 'assoc .py=PythonScript' | wine cmd \
112130 && echo 'ftype PythonScript=c:\p ython\p ython.exe "%1" %*' | wine cmd \
113131 && while pgrep wineserver >/dev/null; do echo "Waiting for wineserver" ; sleep 1; done \
@@ -123,24 +141,6 @@ RUN pip install cython pyinstaller
123141# debug command
124142RUN python -c "import sys; print(sys.path)"
125143
126- # Set working directory to Wine drive C
127- WORKDIR "$W_DRIVE_C"
128-
129- # Download GCC to set up a cross-compiling environment
130- # MSVCRT 64bit runtime https://winlibs.com/#download-release
131- ADD https://github.com/brechtsanders/winlibs_mingw/releases/download/14.2.0posix-19.1.1-12.0.0-msvcrt-r2/winlibs-x86_64-posix-seh-gcc-14.2.0-llvm-19.1.1-mingw-w64msvcrt-12.0.0-r2.zip "winlibs.zip"
132- RUN unzip "winlibs.zip" -d './' \
133- && ls\
134- && rm winlibs.zip\
135- && wine reg add "HKEY_CURRENT_USER\E nvironment" /v PATH /t REG_SZ /d "C:\\ mingw64\b in;%PATH%" /f \
136- && echo "gcc --version" | wine cmd
137-
138- # Update PyConfig.h file
139- COPY ../py_conf_update.sh /py_conf_update.sh
140- RUN chmod a+rx /py_conf_update.sh\
141- && /py_conf_update.sh\
142- && rm /py_conf_update.sh
143-
144144# Create /src directory and link it to Wine's C drive
145145RUN mkdir /src/ && ln -s /src /wine/drive_c/src
146146
0 commit comments