From a8f6db8ba9f40a753d5bf12bb02765b69a7a7542 Mon Sep 17 00:00:00 2001 From: Manuel Thalmann Date: Sun, 26 Mar 2023 23:41:30 +0200 Subject: [PATCH] Start Xvfb before doing anything else --- Dockerfile | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/Dockerfile b/Dockerfile index 109574c..c33eca9 100644 --- a/Dockerfile +++ b/Dockerfile @@ -32,6 +32,19 @@ RUN \ installerExtension=".exe"; \ installer="$(mktemp --suffix="$installerExtension")"; \ installerName="$(basename "$installer" | sed "s/$installerExtension$//")"; \ + export DISPLAY=:90; \ + mkdir -p --mode=777 /tmp/.X11-unix; \ + # Create job for waiting for Xvfb to start + watchStarting="$(mktemp)"; \ + { 2>&1 inotifywait -e create /tmp/.X11-unix/; } | { sed -u -e "/^Watches established.\$/e rm \"$watchStarting\""; } & \ + displayResolver="$!"; \ + while [ -f "$watchStarting" ]; do true; done; \ + { \ + # Improve arguments for screenshots + ARGS="$([ $DEBUG -eq 1 ] && echo "-screen 0 640x480x24 -dpi 192" || echo "")"; \ + Xvfb "${DISPLAY}" ${ARGS} & \ + }; \ + displayPID="$!"; \ rm "$installer"; \ wget "${KEIL_URL}" --progress=bar:force:noscroll -O "$installer"; \ [ "$DEBUG" -eq 1 ] && { \ @@ -153,19 +166,6 @@ RUN \ kill_installer() { \ pkill -9 "$installerName" > /dev/null 2>&1; \ }; \ - export DISPLAY=:90; \ - mkdir -p --mode=777 /tmp/.X11-unix; \ - # Create job for waiting for Xvfb to start - watchStarting="$(mktemp)"; \ - { 2>&1 inotifywait -e create /tmp/.X11-unix/; } | { sed -u -e "/^Watches established.\$/e rm \"$watchStarting\""; } & \ - displayResolver="$!"; \ - while [ -f "$watchStarting" ]; do true; done; \ - { \ - # Improve arguments for screenshots - ARGS="$([ $DEBUG -eq 1 ] && echo "-screen 0 640x480x24 -dpi 192" || echo "")"; \ - Xvfb "${DISPLAY}" ${ARGS} & \ - }; \ - displayPID="$!"; \ # Wait for Xvfb to start wait "$displayResolver"; \ /usr/bin/entrypoint wine reg add 'HKLM\Software\Wine\winedbg' /V ShowCrashDialog /T REG_DWORD /D 0; \