WINE 32-bit Emulation Inside a Docker Container. Running Windows Applications Inside Docker Inside 64-bit Linux.

WINE 32-bit Emulation Inside a Docker Container. Running Windows Applications Inside Docker Inside 64-bit Linux.
Pour the Wine.

ParrotOS 7.1 and many of the latest Linux variants have started trimming 32-bit library support (supposedly to prevent bloat.) This means that Windows Emulators or WINE are becoming more and more difficult to run. This guide will show you how to end-run this limitation and run your Windows Emulated Basic Applications.

  • In this case ParrotOS 7.1 simply did not have the 32-bit libraries, or only partial support.
  • It required starting with a docker image that still supported the 32-bit libraries!
  • winetricks had to be manually found and copied into the image, it simply was not anywhere.

Install your docker / docker support (another quick guide)

curl -fsSL https://get.docker.com | sudo sh

Now make a directory for your Dockerfile, and support files

  • You will need to manually get winetricks. Winetricks is important, as many pieces of software will not work without it.
mkdir wine-script
cd wine-script
wget https://raw.githubusercontent.com/Winetricks/winetricks/master/src/winetricks
chmod +x ./winetricks
  • Now make a Dockerfile and put this inside it.
FROM debian:bookworm-slim

# Enable 32-bit architecture and required repositories
RUN dpkg --add-architecture i386 && \
apt-get update
RUN apt-get install -y --no-install-recommends ca-certificates wget gnupg software-properties-common
COPY winetricks /usr/local/bin/winetricks
RUN chmod +x /usr/local/bin/winetricks
RUN apt-get update
RUN apt-get install cups printer-driver-cups-pdf
RUN apt-get install -y --no-install-recommends xauth xvfb wine wine32:i386 wine64 libwine:i386 fonts-wine
RUN apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*

# Set Wine to 32-bit prefix by default
ENV WINEARCH=win32 WINEPREFIX=/wine

# Initialize Wine prefix non-interactively
RUN xvfb-run -a wineboot --init --update

CMD ["bash"]

You can now build it with:

docker build -t my-wine32 .

And because you need a fair number of parameters to run this container you will need a second script to run it as in (run.sh)

docker run -it --rm \
--network=host \
-e DISPLAY=$DISPLAY \
-v /tmp/.X11-unix:/tmp/.X11-unix:ro \
-v "${XAUTHORITY:-/dev/null}":/root/.Xauthority:ro \
my-wine32 \
bash
  • It is important to note that this built the docker container with X-11 support, then when it is run it copies the X-11 environment to the root account  that you are running the container in.

Then make at executable as in:

chmod +x run.sh
└──╼ $./run.sh
Emulate Docker CLI using podman. Create /etc/containers/nodocker to quiet msg.
root@parrot:/#
  • Testing The Wine32 Container

One can test the container with:

winetricks --version
Executing cd /usr/local/bin
20260125-next - sha256sum: 8f07319f32e96a7ad92f786bf8ee2e00d3c65f82debd33b6884e681b825ae67a
Linux Rocks Every Day