-
-
Notifications
You must be signed in to change notification settings - Fork 48
Install Guide Wine Docker
This page covers the Dockerfile in this project's repository, at Guides/Wine/Docker/Dockerfile. It builds an Ubuntu 24.04 container with Wine 11.15 (devel) and its dependencies preinstalled, as an alternative to installing Wine directly on your host system as in Install Guide: Wine.
The Dockerfile itself has no prose documentation. This page describes what the image actually does, based on building and running it directly rather than guessing from the file alone. Two real issues turned up during that testing; see Known Issues below. This page is marked in-progress because Affinity itself was not installed and launched end-to-end inside the container during this testing.
- Starts from
ubuntu:24.04. - Enables the 32-bit (
i386) architecture, and installs base packages: X11 client libraries,xvfb(a virtual framebuffer, for headless display), audio libraries, Vulkan/Mesa drivers, and general utilities likecurl,wget, andcabextract. - Adds the WineHQ APT repository, and installs
winehq-devel(Wine 11.15 at build time) andwinetricks. - Creates a non-root user,
dev, and switches to it. All later steps, and the container's default shell, run as this user. - Runs
wineboot --initto create a WINEPREFIX at/home/dev/.affinity. - Runs
winetricks -q remove_mono vcrun2022 dotnet48 corefonts win11to install Affinity's runtime dependencies, the same set used in the manual guide's Step 3. - Downloads the same WinRT helper files used in Install Guide: Wine, Step 5 (
Windows.winmdand thewintypesshim) into/tmp/affinity-helpers. - Writes two convenience scripts,
setup_affinity_runtime.shandrun_affinity.sh, meant to copy those helper files into place once you've installed Affinity, and to launch Affinity afterward. - Ends with
CMD ["/bin/bash"], so the container drops you at a shell rather than running anything automatically.
The image does not include an Affinity installer. You bring your own downloaded .exe, the same one used in Install Guide: Wine, Step 4, and mount it into the container.
From the Guides/Wine/Docker directory:
docker build -t affinity-wine .This was tested successfully with Docker 29.7.2 on the AffinityOnLinux repository's current Dockerfile. Expect the build to take a while: the base package install and Wine/winetricks download are the bulk of it.
Since Affinity is a GUI application, you need to give the container access to a display. On a typical Linux desktop with X11 (including XWayland), the usual pattern is to share your host's X11 socket:
xhost +local:docker
docker run -it --rm \
-e DISPLAY=$DISPLAY \
-v /tmp/.X11-unix:/tmp/.X11-unix:rw \
-v "$HOME/Downloads:/home/dev/Downloads:ro" \
affinity-wineThe Dockerfile sets DISPLAY=:0 itself, but that only works if your host's actual display also happens to be :0. Passing -e DISPLAY=$DISPLAY overrides it with the correct value for your session. The Dockerfile does not do this X11 wiring for you. It also doesn't include a VNC or noVNC server, even though it installs xvfb. On its own, xvfb gives you a virtual, invisible display, useful for headless testing of Wine commands, but not for actually seeing Affinity's window. To see the window, pair xvfb with a VNC server (not included), or forward a real X11 socket as above.
Once inside the container, you land at a bash prompt as the dev user, with $WINEPREFIX already set to /home/dev/.affinity.
Follow the same installer step as the manual guide, pointing at wherever you mounted your downloaded .exe:
wine "$HOME/Downloads/Affinity x64.exe"The Dockerfile's setup_affinity_runtime.sh script is meant to copy the pre-downloaded Windows.winmd and wintypes shim into place once Affinity is installed, and remind you to run winecfg to set the wintypes library override. As tested, this script and run_affinity.sh are both written to the image as empty (0-byte) files. See Known Issues. Until that's fixed, do this step manually instead, following Install Guide: Wine, Steps 5 through 7:
mkdir -p "$WINEPREFIX/drive_c/windows/system32/winmetadata"
cp /tmp/affinity-helpers/Windows.winmd "$WINEPREFIX/drive_c/windows/system32/winmetadata/"
cp /tmp/affinity-helpers/wintypes_shim.dll.so "$WINEPREFIX/drive_c/Program Files/Affinity/Affinity/wintypes.dll"
winecfgThen set the wintypes library override to Native (Windows) as described in that step.
wine "$WINEPREFIX/drive_c/Program Files/Affinity/Affinity/Affinity.exe"Confirm you passed through a real X11 socket and DISPLAY value as shown above, rather than relying on the Dockerfile's baked-in DISPLAY=:0. If you only need to run non-interactive Wine commands (for example, to script an unattended install), prefix them with xvfb-run -a, which was confirmed working in testing: xvfb-run -a wine cmd /c ver.
See the winetricks issue below. Check whether dotnet48, corefonts, and the win11 version override actually installed, by inspecting the prefix, before assuming they're present.
Both found through direct testing of this Dockerfile on 2026-08-21/22, with Docker 29.7.2:
-
winetricks silently stops after
vcrun2022in the dependency step. Thevcrun2022component'svc_redist.x86.exedownload failed its SHA256 checksum verification during testing (Microsoft has updated the file since winetricks' known hash was recorded), which made winetricks abort. Because the Dockerfile'sRUN winetricks -q remove_mono vcrun2022 dotnet48 corefonts win11 || trueline has|| true, the Docker build step still reports success, butdotnet48,corefonts, andwin11are never actually installed. Confirmed in a built container: nomscorlibfiles existed anywhere under the prefix, no Windows fonts were installed, andwine cmd /c verstill reported Windows 10 (10.0.19045), not Windows 11. If you hit this, install the remaining components yourself inside the container, for examplewinetricks --force dotnet48 corefonts win11(accepting or bypassing the vcrun2022 checksum mismatch as needed), the same way the manual guide's Manual Winetricks Install section works around winetricks problems. -
The two convenience scripts are written as empty files.
setup_affinity_runtime.shandrun_affinity.share both generated in the Dockerfile using aRUN cat << 'EOF' > file ... EOFheredoc. In testing, both ended up as 0-byte files in the built image, so running either script does nothing (exits immediately with no output). Use the manual commands under Finishing WinRT setup and Launching Affinity above instead until this is fixed upstream in the Dockerfile.
Usage steps beyond what's verified above (in particular, an actual end-to-end Affinity install and launch through a forwarded display, inside the container) are not yet confirmed. Tracked on the Roadmap.
The Dockerfile is useful for testing a clean Wine 10.17+/11.x environment without touching your host system, or for CI-style automated testing. For day-to-day use of Affinity, the direct Install Guide: Wine is better supported and better tested.
Start Here
Install Guides
- Wine
- ↳ Uninstalling
- ↳ Wine in Docker 🟨
- Lutris
- ↳ OpenCL
- Heroic
- Bottles
- Rum
- ↳ Installer GUI
⚠️ - Script Installer
Fixes & Tweaks
- Settings Not Saving
- Panels & Dock Layout
- Login Solution and Scripts
- Tips and Tweaks
⚠️ General Known Issues
Related Projects
Reference
Community & Status