Ensure Xvfb is only started once the watcher is running

This commit is contained in:
Manuel Thalmann 2023-03-24 10:31:51 +00:00
parent 0dbb721635
commit 848754d84a

View file

@ -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 ""); \