diff --git a/Dockerfile b/Dockerfile index 06b3689..757d1d3 100644 --- a/Dockerfile +++ b/Dockerfile @@ -9,6 +9,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends \ tzdata \ xvfb \ x11vnc \ + x11-utils \ novnc \ websockify \ fluxbox \ diff --git a/docker/entrypoint.sh b/docker/entrypoint.sh index f16a020..bac874c 100755 --- a/docker/entrypoint.sh +++ b/docker/entrypoint.sh @@ -29,10 +29,16 @@ echo "[entrypoint] starting Xvfb on ${DISPLAY} (${GEOMETRY})" Xvfb "${DISPLAY}" -screen 0 "${GEOMETRY}" -ac +extension RANDR & XVFB_PID=$! -# Give Xvfb a moment to come up. -for _ in 1 2 3 4 5 6 7 8 9 10; do - if xdpyinfo -display "${DISPLAY}" >/dev/null 2>&1; then break; fi +# Give Xvfb a moment to come up. Requires x11-utils (xdpyinfo). +for i in $(seq 1 50); do + if xdpyinfo -display "${DISPLAY}" >/dev/null 2>&1; then + echo "[entrypoint] Xvfb is ready after ${i} checks" + break + fi sleep 0.2 + if [ "${i}" = "50" ]; then + echo "[entrypoint] WARNING: Xvfb did not respond after 10s" >&2 + fi done # Minimal window manager so dialogs and tabs aren't stuck behind the root window.