FROM ubuntu # Install Wine # BEGIN Based on https://github.com/scottyhardy/docker-remote-desktop/blob/master/Dockerfile # and https://github.com/scottyhardy/docker-wine/blob/master/Dockerfile RUN apt-get update \ && DEBIAN_FRONTEND="noninteractive" apt-get install -y --no-install-recommends \ dbus-x11 \ git \ openssh-client \ locales \ sudo \ x11-xserver-utils \ xfce4 \ xorgxrdp \ xrdp \ xubuntu-icon-theme \ apt-transport-https \ ca-certificates \ cabextract \ git \ gnupg \ gosu \ gpg-agent \ locales \ sudo \ tzdata \ unzip \ wget \ winbind \ xvfb \ zenity \ && rm -rf /var/lib/apt/lists/* ARG WINE_BRANCH="stable" 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 \ && dpkg --add-architecture i386 \ && apt-get update \ && DEBIAN_FRONTEND="noninteractive" apt-get install -y --install-recommends wine-${WINE_BRANCH} \ && rm -rf /var/lib/apt/lists/* ENV PATH "/opt/wine-stable/bin:$PATH" COPY entrypoint.sh /usr/bin/entrypoint # Install winetricks RUN wget -nv -O /usr/bin/winetricks https://raw.githubusercontent.com/Winetricks/winetricks/master/src/winetricks \ && chmod +x /usr/bin/winetricks # Configure locale for unicode RUN locale-gen en_US.UTF-8 ENV LANG en_US.UTF-8 #END Based on ENV WINEDEBUG "fixme-all" ENV RUN_AS_ROOT "yes" ENV USE_XVFB "yes" ENV XVFB_SERVER ":95" ENV XVFB_SCREEN "0" ENV XVFB_RESOLUTION "1024x768x16" ENV DISPLAY ":95" ENV WINEARCH win32 ENV XDG_RUNTIME_DIR "/tmp" COPY tools/* /root/.wine/drive_c/windows/system32/ COPY VisualStudioMock/bin/Release/net472/VisualStudioMock.exe /root/.wine/drive_c/VisualStudioMock.exe RUN set -x -e; \ # Initialize wine # HACK for Wine 10 bug where the wineboot --init ends with "run_wineboot boot event wait timed out" (https://bugs.mandrivalinux.com.narkive.com/hFZTjKnl/bug-58914-wine-new-wine-hangs-while-creating-initial-configuration-in-wine) # DISPLAY= prevents access to the display and allows the init to complete #entrypoint wineboot --init; \ entrypoint whoami; \ DISPLAY= wineboot --init; \ # Install dotnet # get latest version and its hash from https://dotnet.microsoft.com/en-us/download/dotnet wget -nv https://builds.dotnet.microsoft.com/dotnet/Sdk/10.0.100/dotnet-sdk-10.0.100-win-x86.exe --no-check-certificate -O /tmp/dotnet.exe; \ echo dce046f4104ef10d528a9e710cbd8f3fd6b1f4d9ab2ebf3a6889d781a367b5f9ae33fb3fed0d1431ced435aa4d2cd477671ab42e30d03475148012c4d081460c /tmp/dotnet.exe > /tmp/chk; \ sha512sum -c /tmp/chk; \ while pgrep wineserver >/dev/null; do echo "Waiting for wineserver to complete"; sleep 1; done; \ while true; do \ if timeout 30m wine z:\\tmp\\dotnet.exe /q; then \ break; \ fi \ done; \ # Install proper NET Framework so that tlbexp.exe works winetricks -q dotnet48; \ # Install obfuscator # Note: We use the executables from nuget as it allows EAZFUSCATOR_NET_LICENSE. There is no # alternative to set the license key in the MSI delivered binaries using command line. wget -nv https://www.nuget.org/api/v2/package/Gapotchenko.Eazfuscator.NET/2025.3.195 -O /tmp/eaz.zip; \ unzip /tmp/eaz.zip -d /tmp/eaz; \ mv /tmp/eaz/tools /root/.wine/drive_c/users/root/Eazfuscator; \ # at least Windows 8.1, Windows Server 2012 R2 is required for 2024.1 winetricks win10; \ PATH_QUERY_RES=`wine reg query "HKLM\\SYSTEM\\CurrentControlSet\\Control\\Session Manager\\Environment" /v PATH`; \ # extract value PATH_DIRTY=${PATH_QUERY_RES#*REG_EXPAND_SZ}; \ # trim start PATH_TRIMMED_LEFT=${PATH_DIRTY#${PATH_DIRTY%%[![:space:]]*}}; \ # trim end PATH_VALUE=${PATH_TRIMMED_LEFT%${PATH_TRIMMED_LEFT##*[![:space:]]}}; \ wine reg add "HKLM\\SYSTEM\\CurrentControlSet\\Control\Session Manager\\Environment" /v PATH /t REG_EXPAND_SZ /d "C:\\Users\\root\\Eazfuscator\\Launcher;$PATH_VALUE" /f; \ wine reg add "HKLM\\SYSTEM\\CurrentControlSet\\Control\Session Manager\\Environment" /v EAZFUSCATOR_NET_LICENSE /t REG_SZ /d "536RNHZY-8TQG3WNN-SABF783J-Y9UPYU8A-FUT7B3NC-AP7KLK74-QJD4TAVA-S3C4PC8P"; \ # Install socat to temporarily overcome bug until dotnet 9 gets released and have the bug https://github.com/dotnet/runtime/issues/98441 fixed apt update; \ apt install -y --no-install-recommends socat; \ # Register VisualStudioMock wine "c:\\VisualStudioMock.exe" /reg; \ # HACK: Wait for the registry writes to complete in Wine # (see more at https://serverfault.com/questions/1082578/wine-in-docker-reg-add-only-keeps-effects-temporarily) sleep 20; \ # Clean-up rm -rf /tmp/eaz.zip /tmp/eaz /tmp/dotnet.exe /tmp/chk /var/lib/apt/lists/*; \ # Complete echo Usage: wine "c:\program files\dotnet\dotnet.exe" build --configuration Release --no-dependencies Test.wixproj COPY Eazfuscator-Launcher/bin/Release/net472/Eazfuscator-Launcher.exe /root/.wine/drive_c/users/root/Eazfuscator/Launcher/Eazfuscator.NET.exe ENTRYPOINT ["/usr/bin/entrypoint"] # DEBUG Windows apps # xhost +local:docker # docker run --rm -it --env DISPLAY=$DISPLAY --volume /tmp/.X11-unix:/tmp/.X11-unix bash # wine explorer # problems with wine packages: iptables -t nat -A PREROUTING -d 151.101.194.217/32 -p tcp -m tcp --dport 443 -j DNAT --to-destination 151.101.66.217:443