Skip to content

Commit 4605174

Browse files
committed
Update Dockerfile to use image version 3.10.2 FOR RELEASE
This (3.10.2) is highest python version i was able to make it work starting from 3.10.3 msi file extraction(probably dev.msi) causes stack overflow error and the key files for cython and pyinstaller are not supplied
1 parent a4ddd07 commit 4605174

3 files changed

Lines changed: 26 additions & 110 deletions

File tree

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM zamkorus/cythinst64:latest
1+
FROM zamkorus/cythinst64:3.10.2
22

33
# Copy entrypoint and Cython build scripts into the container
44
COPY ../entrypoint.sh /entrypoint.sh

Dockerfiles/Dockerfile

Lines changed: 0 additions & 84 deletions
This file was deleted.

Sources/Dockerfile

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,13 @@
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
55
ENV 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
128
RUN 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\Environment" /v PATH /t REG_SZ /d "C:\\mingw64\bin;%PATH%" /f \
81+
&& echo "gcc --version"| wine cmd
82+
83+
7484
# Set working directory to Wine drive C
7585
WORKDIR "$W_DRIVE_C"
7686

7787
# Define the Python FTP repository for MSI installation files
88+
ARG PYTHON_VERSION=3.10.2
7889
ARG 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
90101
RUN 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
98109
ENV 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
101118
ADD 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:\python\Scripts\pyupdater.exe'\'' "$@"' > /usr/bin/pyupdater \
109126
&& echo 'wine '\''C:\python\Scripts\cython.exe'\'' "$@"' > /usr/bin/cython \
110127
&& echo 'wine '\''C:\python\Scripts\cythonize.exe'\'' "$@"' > /usr/bin/cythonize \
128+
&& wine --version \
111129
&& echo 'assoc .py=PythonScript' | wine cmd \
112130
&& echo 'ftype PythonScript=c:\python\python.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
124142
RUN 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\Environment" /v PATH /t REG_SZ /d "C:\\mingw64\bin;%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
145145
RUN mkdir /src/ && ln -s /src /wine/drive_c/src
146146

0 commit comments

Comments
 (0)