Skip to content

Instantly share code, notes, and snippets.

@NitroHxC
Last active November 20, 2025 15:49
Show Gist options
  • Select an option

  • Save NitroHxC/19268b7b6c113da585d6b1c505e2bf71 to your computer and use it in GitHub Desktop.

Select an option

Save NitroHxC/19268b7b6c113da585d6b1c505e2bf71 to your computer and use it in GitHub Desktop.
Dockerfile to run Fork git client on Wine in Ubuntu 20.04 container
version: '3'
services:
fork:
build: .
ports:
- '5900:5900'
###########################################
# Proof of concept for running Fork git client on Wine on Ubuntu 20.04.
# 70% of the credit to GPT-4 :)
######## Instructions:
# copy both Dockerfile and docker-compose.yml in the same folder
# run `docker-compose build`
# wait for a long time
# run `docker-compose up -d`
# connect with TigerVNC to `localhost:5900`
# open a terminal and run:
# wine '/root/.wine/drive_c/users/root/AppData/Local/Fork/app-1.82.1/Fork.exe'
###########################################
FROM dorowu/ubuntu-desktop-lxde-vnc:latest
# Set environment variables
ENV WINEPREFIX /root/.wine
ENV WINEARCH win64
ENV DISPLAY :0
ENV DEBIAN_FRONTEND=noninteractive
# Update package lists and install required packages
RUN apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 4EB27DB2A3B88B8B
RUN dpkg --add-architecture i386 && \
apt-get update && \
apt-get install -y --no-install-recommends \
wget \
curl \
gnupg2 \
software-properties-common \
xvfb \
x11vnc \
winbind
# Add Wine repository and install Wine staging
RUN wget -qO - https://dl.winehq.org/wine-builds/winehq.key | apt-key add - && \
apt-add-repository 'deb https://dl.winehq.org/wine-builds/ubuntu/ focal main' && \
apt-get update && \
apt-get install -y --install-recommends winehq-staging
# Install Winetricks
RUN wget https://raw.githubusercontent.com/Winetricks/winetricks/master/src/winetricks && \
chmod +x winetricks && \
mv winetricks /usr/local/bin
# Install .NET and d3dcompiler_47 with Winetricks
RUN winetricks -q dotnet48 d3dcompiler_47
# Download and install Fork
RUN wget -O ForkInstaller.exe "https://fork.dev/update/win/ForkInstaller.exe" && \
xvfb-run wine ForkInstaller.exe /VERYSILENT /SUPPRESSMSGBOXES && \
rm ForkInstaller.exe
# Disable hardware acceleration for WPF
RUN wine reg add "HKCU\\SOFTWARE\\Microsoft\\Avalon.Graphics" /v DisableHWAcceleration /t REG_DWORD /d>
# Expose VNC port
EXPOSE 5900
# Run wine on container startup
# CMD ["sh", "-c", "wine '/root/.wine/drive_c/users/root/AppData/Local/Fork/app-1.82.1/Fork.exe'"]
# Unfortunately this last line was not working. Had to open VNC and run from terminal
# THE END
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment