I am using an architecture which supports Windows system only. I have setup a Jenkins server for CI/CD. I am using Wine with Ubuntu:20.04 in Docker to build my source and package it on Jenkins.
I also wanted Python3.8 to make my builds work, so I am using embed python (Had faced issues while installing .msi python installer on Wine). Now, I require few packages that does not come with and has to be installed using PIP. Upon few searches I came to know that there is no official PIP support for embed python, but with few hacks, we can make it work. I tried the solutions, it worked, but I am unable to install few libraries like uuid.
FROM ubuntu:20.04
RUN dpkg --add-architecture i386
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update \
&& apt-get install gnupg2 wget software-properties-common -y \
&& wget -nc https://dl.winehq.org/wine-builds/winehq.key \
&& apt-key add winehq.key \
&& apt-add-repository 'deb https://dl.winehq.org/wine-builds/ubuntu/ focal main' \
&& apt-get install -y --no-install-recommends winehq-stable
RUN wine --version
RUN mkdir -p /wine/python
RUN cd /wine/python \
&& wget https://www.python.org/ftp/python/3.8.8/python-3.8.8-embed-amd64.zip \
&& unzip python-3.8.8-embed-amd64.zip \
&& rm -f python-3.8.8-embed-amd64.zip
ENV WINEPREFIX /wine
ENV WINEPATH Z:\\wine\\python\\Scripts;Z:\\wine\\python
# A hack to make pip work with embedded python.
ENV WINEARCH win64
ENV WINEDEBUG fixme-all
RUN wineboot --init
RUN cd /wine/python \
&& mv python38._pth python38._pth.backup \
&& wget https://bootstrap.pypa.io/get-pip.py
RUN wineboot --restart
# We need to provide random value to initialize Python during docker build
ENV PYTHONHASHSEED=4294967295
RUN cd /wine/python \
&& wine cmd /c python --version \
&& wine cmd /c python get-pip.py
RUN wine cmd /c python -m pip --help
RUN wine cmd /c pip3 install uuid
RUN ls /wine/python/Scripts
Installing uuid does not work:
Step 24/27 : RUN cd /scratch/wine/python && wine cmd /c python --version && wine cmd /c python get-pip.py
---> Using cache
---> c18f16be8ed0
Step 25/27 : RUN wine cmd /c python -m pip --help
---> Using cache
---> 7599ef6a410d
Step 26/27 : RUN wine cmd /c pip3 install uuid
---> Running in 3df04cc0faa4
Collecting uuid
ERROR: Could not install packages due to an OSError: [WinError -2146893801] Windows Error 0x80090017
Can anyone help me, please?