From 848754d84a4594e550b69dfeff5132a375a73ec0 Mon Sep 17 00:00:00 2001 From: Manuel Thalmann Date: Fri, 24 Mar 2023 10:31:51 +0000 Subject: [PATCH] Ensure `Xvfb` is only started once the watcher is running --- Dockerfile | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 7040381..35bc8c4 100644 --- a/Dockerfile +++ b/Dockerfile @@ -127,8 +127,10 @@ RUN \ export DISPLAY=$display; \ mkdir -p --mode=777 /tmp/.X11-unix; \ # Create job for waiting for Xvfb to start - { inotifywait -e create /tmp/.X11-unix/ 2>&1 > /dev/null & }; \ + watchStarting="$(mktemp)"; \ + { 2>&1 inotifywait -e create /tmp/.X11-unix/; } | { sed -u -e "/^Watches established.\$/e rm \"$watchStarting\""; } & \ resolver=$!; \ + while [ -f "$watchStarting" ]; do true; done; \ { \ # Improve arguments for screenshots ARGS=$([ $DEBUG -eq 1 ] && echo "-screen 0 640x480x24 -dpi 192" || echo ""); \