From caa7e1da2eb3f1f2cf140f0ac73b0b255081807e Mon Sep 17 00:00:00 2001 From: Roman Vanicek Date: Thu, 24 Oct 2024 12:36:02 +0200 Subject: [PATCH] Restore X11 dependent packages, add proper entrypoint --- Dockerfile | 9 +++++++-- entrypoint.sh | 17 +++++++++++++++++ 2 files changed, 24 insertions(+), 2 deletions(-) create mode 100755 entrypoint.sh diff --git a/Dockerfile b/Dockerfile index a8224cd..c259cc7 100644 --- a/Dockerfile +++ b/Dockerfile @@ -16,9 +16,10 @@ RUN apt-get update \ unzip \ wget \ winbind \ + xvfb \ + zenity \ && rm -rf /var/lib/apt/lists/* -# Install wine 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 \ @@ -27,6 +28,8 @@ RUN wget -nv -O- https://dl.winehq.org/wine-builds/winehq.key | APT_KEY_DONT_WAR && DEBIAN_FRONTEND="noninteractive" apt-get install -y --install-recommends wine-${WINE_BRANCH} \ && rm -rf /var/lib/apt/lists/* +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 @@ -47,7 +50,7 @@ COPY tools/* /root/.wine/drive_c/windows/system32/ RUN set -x -e; \ # Install dotnet - wineboot --init; \ + entrypoint wineboot --init; \ # get latest version and its hash from https://dotnet.microsoft.com/en-us/download/dotnet wget https://download.visualstudio.microsoft.com/download/pr/7ce6d94a-13c1-4102-bb1b-b0f7ea5afb6e/0764c80c81c16ab927c0a7321f7c07cf/dotnet-sdk-8.0.303-win-x86.exe --no-check-certificate -O /tmp/dotnet.exe; \ echo af52649a05bb3c8ba494291234d67f3385446a8a08eaefcbe9fbc4e766ae97a6a13253060a798ce076511fa59086b1d9fa638b51a5e748bcfc79d36ddc7991ca /tmp/dotnet.exe > /tmp/chk; \ @@ -90,6 +93,8 @@ RUN set -x -e; \ 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 diff --git a/entrypoint.sh b/entrypoint.sh new file mode 100755 index 0000000..55371d1 --- /dev/null +++ b/entrypoint.sh @@ -0,0 +1,17 @@ +#!/usr/bin/env bash + +# Create the user account +groupadd --gid 1020 ubuntu +useradd --shell /bin/bash --uid 1020 --gid 1020 --password $(openssl passwd ubuntu) --create-home --home-dir /home/ubuntu ubuntu +usermod -aG sudo ubuntu + +# Start xrdp sesman service +/usr/sbin/xrdp-sesman + +# Run xrdp in foreground if no commands specified +if [ -z "$1" ]; then + /usr/sbin/xrdp --nodaemon +else + /usr/sbin/xrdp + exec "$@" +fi \ No newline at end of file