Skip to content

Commit

Permalink
v1.2.2
Browse files Browse the repository at this point in the history
  • Loading branch information
bitjerry committed Oct 30, 2022
1 parent 24ffd9e commit 2c1d383
Show file tree
Hide file tree
Showing 7 changed files with 45 additions and 83 deletions.
40 changes: 18 additions & 22 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,41 +1,37 @@
FROM ubuntu:20.04
FROM i386/debian:buster-slim

ENV DEBIAN_FRONTEND noninteractive
ENV LC_ALL C.UTF-8
ENV LANG en_US.UTF-8
ENV LANGUAGE en_US.UTF-8
ENV WINEPREFIX /root/wine
ENV WINEPREFIX /root/.wine
ENV WINEARCH win32
ENV WINEDEBUG -all

ARG PYTHON_VERSION=3.10.8

#Install Tool
RUN apt-get update \
&& apt-get install -y --install-recommends \
software-properties-common \
wget \
xvfb

#Intall Wine
COPY wine-init.sh /

RUN wget -nv -O- https://dl.winehq.org/wine-builds/winehq.key | APT_KEY_DONT_WARN_ON_DANGEROUS_USAGE=1 apt-key add - \
&& echo "deb https://dl.winehq.org/wine-builds/ubuntu/ $(grep VERSION_CODENAME= /etc/os-release | cut -d= -f2) main" >> /etc/apt/sources.list \
&& apt-get install -y --install-recommends ca-certificates gnupg wget xvfb \
&& wget -nv -O- https://dl.winehq.org/wine-builds/winehq.key | APT_KEY_DONT_WARN_ON_DANGEROUS_USAGE=1 apt-key add - \
&& echo "deb https://dl.winehq.org/wine-builds/debian/ $(grep VERSION_CODENAME= /etc/os-release | cut -d= -f2) main" >> /etc/apt/sources.list \
&& dpkg --add-architecture i386 \
&& apt-get update \
&& apt-get install -y --no-install-recommends winehq-stable \
&& apt-get install -y --no-install-recommends --no-install-suggests winehq-stable \
&& rm -rf /var/lib/apt/lists/* \
&& xvfb-run sh wine-init.sh

#Install python for Windows
RUN wget https://www.python.org/ftp/python/${PYTHON_VERSION}/python-${PYTHON_VERSION}.exe -O python.exe \
&& xvfb-run sh -c "\
set -e; \
export WINEDLLOVERRIDES="winemenubuilder.exe,mscoree,mshtml="; \
wine reg add 'HKLM\Software\Microsoft\Windows NT\CurrentVersion' /v CurrentVersion /d 10.0 /f; \
wine reg add 'HKCU\Software\Wine\DllOverrides' /v winemenubuilder.exe /t REG_SZ /d '' /f; \
wine reg add 'HKCU\Software\Wine\DllOverrides' /v mscoree /t REG_SZ /d '' /f; \
wine reg add 'HKCU\Software\Wine\DllOverrides' /v mshtml /t REG_SZ /d '' /f; \
wineserver -w" \
&& wget https://www.python.org/ftp/python/${PYTHON_VERSION}/python-${PYTHON_VERSION}.exe -O python.exe \
&& xvfb-run sh -c "\
wine python.exe /quiet TargetDir=C:\\Python \
Include_doc=0 InstallAllUsers=1 PrependPath=1; \
wineserver -w" \
&& rm python.exe

#Clear
RUN apt-get autoremove -y --purge software-properties-common wget \
&& rm python.exe \
&& apt-get autoremove -y --purge ca-certificates gnupg wget \
&& apt-get autoremove -y --purge \
&& apt-get clean -y
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Docker is easy to deploy in any environment, such as the Paas
Wine Some programs must be executed under Windows
Python is a very easy to use and popular programming language

For `Python 3.10.8 32bit for Windows` only
For `Python 3.10.8 32bit for Windows` only, minimum image for python runtime!!!

Does not include the full Windows environment

Expand All @@ -31,11 +31,11 @@ wine python ...
#### Install requirements by pip
```shell
xvfb-run sh -c "\
wine pip install -r requirements.txt; \
wine pip install --no-cache-dir -r requirements.txt; \
wineserver -w"
```

### Copyright

---
MIT © [bitjerry](https://github.com/bitjerry/wine-python/blob/main/LICENSE)
MIT © [bitjerry](https://github.com/bitjerry/wine-python/blob/main/LICENSE)
6 changes: 3 additions & 3 deletions README.zh_cn.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Docker 便于将程序快速部署到任何环境中, 包括 Paas 平台
Wine 某些程序必须在 Windows 环境下执行
Python 毫无疑问, 最简单的编程语言

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

Expand All @@ -30,11 +30,11 @@ wine python ...
#### 使用pip安装依赖
```shell
xvfb-run sh -c "\
wine pip install -r requirements.txt; \
wine pip install --no-cache-dir -r requirements.txt; \
wineserver -w"
```

### 许可

---
MIT © [bitjerry](./LICENSE)
MIT © [bitjerry](./LICENSE)
15 changes: 0 additions & 15 deletions wine-init.sh

This file was deleted.

42 changes: 19 additions & 23 deletions x64/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,41 +1,37 @@
FROM ubuntu:20.04
FROM debian:buster-slim

ENV DEBIAN_FRONTEND noninteractive
ENV LC_ALL C.UTF-8
ENV LANG en_US.UTF-8
ENV LANGUAGE en_US.UTF-8
ENV WINEPREFIX /root/wine
ENV WINEPREFIX /root/.wine
ENV WINEARCH win64
ENV WINEDEBUG -all

ARG PYTHON_VERSION=3.10.8

#Install Tool
RUN apt-get update \
&& apt-get install -y --install-recommends \
software-properties-common \
wget \
xvfb

#Intall Wine
COPY wine-init.sh /

RUN wget -nv -O- https://dl.winehq.org/wine-builds/winehq.key | APT_KEY_DONT_WARN_ON_DANGEROUS_USAGE=1 apt-key add - \
&& echo "deb https://dl.winehq.org/wine-builds/ubuntu/ $(grep VERSION_CODENAME= /etc/os-release | cut -d= -f2) main" >> /etc/apt/sources.list \
&& apt-get install -y --install-recommends ca-certificates gnupg wget xvfb \
&& wget -nv -O- https://dl.winehq.org/wine-builds/winehq.key | APT_KEY_DONT_WARN_ON_DANGEROUS_USAGE=1 apt-key add - \
&& echo "deb https://dl.winehq.org/wine-builds/debian/ $(grep VERSION_CODENAME= /etc/os-release | cut -d= -f2) main" >> /etc/apt/sources.list \
&& dpkg --add-architecture i386 \
&& apt-get update \
&& apt-get install -y --no-install-recommends winehq-stable \
&& apt-get install -y --no-install-recommends --no-install-suggests winehq-stable \
&& rm -rf /var/lib/apt/lists/* \
&& xvfb-run sh wine-init.sh

#Install python for Windows
RUN wget https://www.python.org/ftp/python/${PYTHON_VERSION}/python-${PYTHON_VERSION}-amd64.exe -O python.exe \
&& xvfb-run sh -c "\
set -e; \
export WINEDLLOVERRIDES="winemenubuilder.exe,mscoree,mshtml="; \
wine reg add 'HKLM\Software\Microsoft\Windows NT\CurrentVersion' /v CurrentVersion /d 10.0 /f; \
wine reg add 'HKCU\Software\Wine\DllOverrides' /v winemenubuilder.exe /t REG_SZ /d '' /f; \
wine reg add 'HKCU\Software\Wine\DllOverrides' /v mscoree /t REG_SZ /d '' /f; \
wine reg add 'HKCU\Software\Wine\DllOverrides' /v mshtml /t REG_SZ /d '' /f; \
wineserver -w" \
&& wget https://www.python.org/ftp/python/${PYTHON_VERSION}/python-${PYTHON_VERSION}-amd64.exe -O python.exe \
&& xvfb-run sh -c "\
wine python.exe /quiet TargetDir=C:\\Python \
Include_doc=0 InstallAllUsers=1 PrependPath=1; \
wineserver -w" \
&& rm python.exe

#Clear
RUN apt-get autoremove -y --purge software-properties-common wget \
&& apt-get clean -y
&& rm python.exe \
&& apt-get autoremove -y --purge ca-certificates gnupg wget \
&& apt-get autoremove -y --purge \
&& apt-get clean -y
4 changes: 2 additions & 2 deletions x64/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,11 @@ wine python ...
#### Install requirements by pip
```shell
xvfb-run sh -c "\
wine pip install -r requirements.txt; \
wine pip install --no-cache-dir -r requirements.txt; \
wineserver -w"
```

### Copyright

---
MIT © [bitjerry](https://github.com/bitjerry/wine-python/blob/main/LICENSE)
MIT © [bitjerry](https://github.com/bitjerry/wine-python/blob/main/LICENSE)
15 changes: 0 additions & 15 deletions x64/wine-init.sh

This file was deleted.

0 comments on commit 2c1d383

Please sign in to comment.