Skip to content

Playwright is a framework for Web Testing and Automation. It allows testing Chromium, Firefox and WebKit with a single API.

fix(docker): do not export DISPLAY for everybody without XVFB running (#9795)

Andrey Lushnikov7927920c3529
diff --git a/utils/docker/Dockerfile.bionic b/utils/docker/Dockerfile.bionic
index 58d743aa81..124db261c4 100644
--- a/utils/docker/Dockerfile.bionic
+++ b/utils/docker/Dockerfile.bionic
@@ -31,8 +31,6 @@ RUN apt-get update && apt-get install -y python3.8 python3-pip && \
ARG NOVNC_REF="1.2.0"
ARG WEBSOCKIFY_REF="0.10.0"
-ENV DISPLAY_NUM=99
-ENV DISPLAY=":${DISPLAY_NUM}"
RUN mkdir -p /opt/bin && chmod +x /dev/shm \
&& apt-get update && apt-get install -y unzip fluxbox x11vnc \
diff --git a/utils/docker/Dockerfile.focal b/utils/docker/Dockerfile.focal
index 20ac37cc17..aafd7bd110 100644
--- a/utils/docker/Dockerfile.focal
+++ b/utils/docker/Dockerfile.focal
@@ -31,8 +31,6 @@ RUN apt-get update && apt-get install -y python3.8 python3-pip && \
ARG NOVNC_REF="1.2.0"
ARG WEBSOCKIFY_REF="0.10.0"
-ENV DISPLAY_NUM=99
-ENV DISPLAY=":${DISPLAY_NUM}"
RUN mkdir -p /opt/bin && chmod +x /dev/shm \
&& apt-get update && apt-get install -y unzip fluxbox x11vnc \
diff --git a/utils/docker/start_agent.sh b/utils/docker/start_agent.sh
index 35a0c2f999..349c618487 100644
--- a/utils/docker/start_agent.sh
+++ b/utils/docker/start_agent.sh
@@ -2,6 +2,9 @@
set -e
set +x
+DISPLAY_NUM=99
+export DISPLAY=":${DISPLAY_NUM}"
+
SCREEN_WIDTH=1360
SCREEN_HEIGHT=1020
SCREEN_DEPTH=24