Skip to content

Commit 2c1d383

Browse files
committed
v1.2.2
1 parent 24ffd9e commit 2c1d383

7 files changed

Lines changed: 45 additions & 83 deletions

File tree

Dockerfile

Lines changed: 18 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,37 @@
1-
FROM ubuntu:20.04
1+
FROM i386/debian:buster-slim
22

33
ENV DEBIAN_FRONTEND noninteractive
44
ENV LC_ALL C.UTF-8
55
ENV LANG en_US.UTF-8
66
ENV LANGUAGE en_US.UTF-8
7-
ENV WINEPREFIX /root/wine
7+
ENV WINEPREFIX /root/.wine
88
ENV WINEARCH win32
99
ENV WINEDEBUG -all
1010

1111
ARG PYTHON_VERSION=3.10.8
1212

13-
#Install Tool
1413
RUN apt-get update \
15-
&& apt-get install -y --install-recommends \
16-
software-properties-common \
17-
wget \
18-
xvfb
19-
20-
#Intall Wine
21-
COPY wine-init.sh /
22-
23-
RUN wget -nv -O- https://dl.winehq.org/wine-builds/winehq.key | APT_KEY_DONT_WARN_ON_DANGEROUS_USAGE=1 apt-key add - \
24-
&& echo "deb https://dl.winehq.org/wine-builds/ubuntu/ $(grep VERSION_CODENAME= /etc/os-release | cut -d= -f2) main" >> /etc/apt/sources.list \
14+
&& apt-get install -y --install-recommends ca-certificates gnupg wget xvfb \
15+
&& wget -nv -O- https://dl.winehq.org/wine-builds/winehq.key | APT_KEY_DONT_WARN_ON_DANGEROUS_USAGE=1 apt-key add - \
16+
&& echo "deb https://dl.winehq.org/wine-builds/debian/ $(grep VERSION_CODENAME= /etc/os-release | cut -d= -f2) main" >> /etc/apt/sources.list \
2517
&& dpkg --add-architecture i386 \
2618
&& apt-get update \
27-
&& apt-get install -y --no-install-recommends winehq-stable \
19+
&& apt-get install -y --no-install-recommends --no-install-suggests winehq-stable \
2820
&& rm -rf /var/lib/apt/lists/* \
29-
&& xvfb-run sh wine-init.sh
30-
31-
#Install python for Windows
32-
RUN wget https://www.python.org/ftp/python/${PYTHON_VERSION}/python-${PYTHON_VERSION}.exe -O python.exe \
21+
&& xvfb-run sh -c "\
22+
set -e; \
23+
export WINEDLLOVERRIDES="winemenubuilder.exe,mscoree,mshtml="; \
24+
wine reg add 'HKLM\Software\Microsoft\Windows NT\CurrentVersion' /v CurrentVersion /d 10.0 /f; \
25+
wine reg add 'HKCU\Software\Wine\DllOverrides' /v winemenubuilder.exe /t REG_SZ /d '' /f; \
26+
wine reg add 'HKCU\Software\Wine\DllOverrides' /v mscoree /t REG_SZ /d '' /f; \
27+
wine reg add 'HKCU\Software\Wine\DllOverrides' /v mshtml /t REG_SZ /d '' /f; \
28+
wineserver -w" \
29+
&& wget https://www.python.org/ftp/python/${PYTHON_VERSION}/python-${PYTHON_VERSION}.exe -O python.exe \
3330
&& xvfb-run sh -c "\
3431
wine python.exe /quiet TargetDir=C:\\Python \
3532
Include_doc=0 InstallAllUsers=1 PrependPath=1; \
3633
wineserver -w" \
37-
&& rm python.exe
38-
39-
#Clear
40-
RUN apt-get autoremove -y --purge software-properties-common wget \
34+
&& rm python.exe \
35+
&& apt-get autoremove -y --purge ca-certificates gnupg wget \
36+
&& apt-get autoremove -y --purge \
4137
&& apt-get clean -y

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ Docker is easy to deploy in any environment, such as the Paas
1111
Wine Some programs must be executed under Windows
1212
Python is a very easy to use and popular programming language
1313

14-
For `Python 3.10.8 32bit for Windows` only
14+
For `Python 3.10.8 32bit for Windows` only, minimum image for python runtime!!!
1515

1616
Does not include the full Windows environment
1717

@@ -31,11 +31,11 @@ wine python ...
3131
#### Install requirements by pip
3232
```shell
3333
xvfb-run sh -c "\
34-
wine pip install -r requirements.txt; \
34+
wine pip install --no-cache-dir -r requirements.txt; \
3535
wineserver -w"
3636
```
3737

3838
### Copyright
3939

4040
---
41-
MIT © [bitjerry](https://github.com/bitjerry/wine-python/blob/main/LICENSE)
41+
MIT © [bitjerry](https://github.com/bitjerry/wine-python/blob/main/LICENSE)

README.zh_cn.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ Docker 便于将程序快速部署到任何环境中, 包括 Paas 平台
1111
Wine 某些程序必须在 Windows 环境下执行
1212
Python 毫无疑问, 最简单的编程语言
1313

14-
仅用于 `Python 3.10.8 32bit for Windows`
14+
仅用于 `Python 3.10.8 32bit for Windows`, 最小镜像python运行环境!!!
1515
不包含完整 Windows 环境
1616
如有更多需求请自行修改 Dockerfile
1717

@@ -30,11 +30,11 @@ wine python ...
3030
#### 使用pip安装依赖
3131
```shell
3232
xvfb-run sh -c "\
33-
wine pip install -r requirements.txt; \
33+
wine pip install --no-cache-dir -r requirements.txt; \
3434
wineserver -w"
3535
```
3636

3737
### 许可
3838

3939
---
40-
MIT © [bitjerry](./LICENSE)
40+
MIT © [bitjerry](./LICENSE)

wine-init.sh

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

x64/Dockerfile

Lines changed: 19 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,37 @@
1-
FROM ubuntu:20.04
1+
FROM debian:buster-slim
22

33
ENV DEBIAN_FRONTEND noninteractive
44
ENV LC_ALL C.UTF-8
55
ENV LANG en_US.UTF-8
66
ENV LANGUAGE en_US.UTF-8
7-
ENV WINEPREFIX /root/wine
7+
ENV WINEPREFIX /root/.wine
88
ENV WINEARCH win64
99
ENV WINEDEBUG -all
1010

1111
ARG PYTHON_VERSION=3.10.8
1212

13-
#Install Tool
1413
RUN apt-get update \
15-
&& apt-get install -y --install-recommends \
16-
software-properties-common \
17-
wget \
18-
xvfb
19-
20-
#Intall Wine
21-
COPY wine-init.sh /
22-
23-
RUN wget -nv -O- https://dl.winehq.org/wine-builds/winehq.key | APT_KEY_DONT_WARN_ON_DANGEROUS_USAGE=1 apt-key add - \
24-
&& echo "deb https://dl.winehq.org/wine-builds/ubuntu/ $(grep VERSION_CODENAME= /etc/os-release | cut -d= -f2) main" >> /etc/apt/sources.list \
14+
&& apt-get install -y --install-recommends ca-certificates gnupg wget xvfb \
15+
&& wget -nv -O- https://dl.winehq.org/wine-builds/winehq.key | APT_KEY_DONT_WARN_ON_DANGEROUS_USAGE=1 apt-key add - \
16+
&& echo "deb https://dl.winehq.org/wine-builds/debian/ $(grep VERSION_CODENAME= /etc/os-release | cut -d= -f2) main" >> /etc/apt/sources.list \
2517
&& dpkg --add-architecture i386 \
2618
&& apt-get update \
27-
&& apt-get install -y --no-install-recommends winehq-stable \
19+
&& apt-get install -y --no-install-recommends --no-install-suggests winehq-stable \
2820
&& rm -rf /var/lib/apt/lists/* \
29-
&& xvfb-run sh wine-init.sh
30-
31-
#Install python for Windows
32-
RUN wget https://www.python.org/ftp/python/${PYTHON_VERSION}/python-${PYTHON_VERSION}-amd64.exe -O python.exe \
21+
&& xvfb-run sh -c "\
22+
set -e; \
23+
export WINEDLLOVERRIDES="winemenubuilder.exe,mscoree,mshtml="; \
24+
wine reg add 'HKLM\Software\Microsoft\Windows NT\CurrentVersion' /v CurrentVersion /d 10.0 /f; \
25+
wine reg add 'HKCU\Software\Wine\DllOverrides' /v winemenubuilder.exe /t REG_SZ /d '' /f; \
26+
wine reg add 'HKCU\Software\Wine\DllOverrides' /v mscoree /t REG_SZ /d '' /f; \
27+
wine reg add 'HKCU\Software\Wine\DllOverrides' /v mshtml /t REG_SZ /d '' /f; \
28+
wineserver -w" \
29+
&& wget https://www.python.org/ftp/python/${PYTHON_VERSION}/python-${PYTHON_VERSION}-amd64.exe -O python.exe \
3330
&& xvfb-run sh -c "\
3431
wine python.exe /quiet TargetDir=C:\\Python \
3532
Include_doc=0 InstallAllUsers=1 PrependPath=1; \
3633
wineserver -w" \
37-
&& rm python.exe
38-
39-
#Clear
40-
RUN apt-get autoremove -y --purge software-properties-common wget \
41-
&& apt-get clean -y
34+
&& rm python.exe \
35+
&& apt-get autoremove -y --purge ca-certificates gnupg wget \
36+
&& apt-get autoremove -y --purge \
37+
&& apt-get clean -y

x64/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,11 @@ wine python ...
2929
#### Install requirements by pip
3030
```shell
3131
xvfb-run sh -c "\
32-
wine pip install -r requirements.txt; \
32+
wine pip install --no-cache-dir -r requirements.txt; \
3333
wineserver -w"
3434
```
3535

3636
### Copyright
3737

3838
---
39-
MIT © [bitjerry](https://github.com/bitjerry/wine-python/blob/main/LICENSE)
39+
MIT © [bitjerry](https://github.com/bitjerry/wine-python/blob/main/LICENSE)

x64/wine-init.sh

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

0 commit comments

Comments
 (0)