Skip to content
This repository was archived by the owner on Jun 22, 2024. It is now read-only.

Commit 0c14b8b

Browse files
Merge branch 'trunk' of https://github.com/SeleniumHQ/docker-selenium into trunk
2 parents 4cd38d5 + 17ce8e3 commit 0c14b8b

File tree

3 files changed

+17
-29
lines changed

3 files changed

+17
-29
lines changed

Base/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,9 +92,9 @@ COPY supervisord.conf /etc
9292
RUN mkdir -p /opt/selenium /opt/selenium/assets /var/run/supervisor /var/log/supervisor \
9393
&& touch /opt/selenium/config.toml \
9494
&& chmod -R 777 /opt/selenium /opt/selenium/assets /var/run/supervisor /var/log/supervisor /etc/passwd \
95-
&& wget --no-verbose https://github.com/SeleniumHQ/selenium/releases/download/selenium-4.9.0/selenium-server-4.9.0.jar \
95+
&& wget --no-verbose https://github.com/SeleniumHQ/selenium/releases/download/selenium-4.9.0/selenium-server-4.9.1.jar \
9696
-O /opt/selenium/selenium-server.jar \
97-
&& wget --no-verbose https://repo1.maven.org/maven2/org/seleniumhq/selenium/selenium-http-jdk-client/4.9.0/selenium-http-jdk-client-4.9.0.jar \
97+
&& wget --no-verbose https://repo1.maven.org/maven2/org/seleniumhq/selenium/selenium-http-jdk-client/4.9.1/selenium-http-jdk-client-4.9.1.jar \
9898
-O /opt/selenium/selenium-http-jdk-client.jar \
9999
&& chgrp -R 0 /opt/selenium ${HOME} /opt/selenium/assets /var/run/supervisor /var/log/supervisor \
100100
&& chmod -R g=u /opt/selenium ${HOME} /opt/selenium/assets /var/run/supervisor /var/log/supervisor \

NodeBase/start-vnc.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,12 @@ if [ "${START_XVFB:-$SE_START_XVFB}" = true ] ; then
2828
X11VNC_OPTS="${X11VNC_OPTS} -viewonly"
2929
fi
3030

31+
VNC_PASSWORD=${VNC_PASSWORD:-$SE_VNC_PASSWORD}
32+
if [ ! -z $VNC_PASSWORD ]; then
33+
echo "Starting VNC server with custom password"
34+
x11vnc -storepasswd ${VNC_PASSWORD} ${HOME}/.vnc/passwd
35+
fi
36+
3137
for i in $(seq 1 10)
3238
do
3339
sleep 1

README.md

Lines changed: 9 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -601,7 +601,8 @@ there, and when the test completes, the container gets thrown away.
601601

602602
This execution mode can be used either in the Standalone or Node roles. The "dynamic"
603603
execution mode needs to be told what Docker images to use when the containers get started.
604-
Additionally, the Grid needs to know the URI of the Docker daemon.
604+
Additionally, the Grid needs to know the URI of the Docker daemon. This configuration can
605+
be placed in a local `toml` file.
605606

606607
### Configuration example
607608

@@ -611,14 +612,14 @@ You can save this file locally and name it, for example, `config.toml`.
611612
# Configs have a mapping between the Docker image to use and the capabilities that need to be matched to
612613
# start a container with the given image.
613614
configs = [
614-
"selenium/standalone-firefox:4.9.0-20230421", "{\"browserName\": \"firefox\"}",
615-
"selenium/standalone-chrome:4.9.0-20230421", "{\"browserName\": \"chrome\"}",
616-
"selenium/standalone-edge:4.9.0-20230421", "{\"browserName\": \"MicrosoftEdge\"}"
617-
]
615+
"selenium/standalone-firefox:4.9.0-20230421", '{"browserName": "firefox"}',
616+
"selenium/standalone-chrome:4.9.0-20230421", '{"browserName": "chrome"}',
617+
"selenium/standalone-edge:4.9.0-20230421", '{"browserName": "MicrosoftEdge"}'
618+
]
618619

619620
# URL for connecting to the docker daemon
620621
# Most simple approach, leave it as http://127.0.0.1:2375, and mount /var/run/docker.sock.
621-
# 127.0.0.1 is used because interally the container uses socat when /var/run/docker.sock is mounted
622+
# 127.0.0.1 is used because internally the container uses socat when /var/run/docker.sock is mounted
622623
# If var/run/docker.sock is not mounted:
623624
# Windows: make sure Docker Desktop exposes the daemon via tcp, and use http://host.docker.internal:2375.
624625
# macOS: install socat and run the following command, socat -4 TCP-LISTEN:2375,fork UNIX-CONNECT:/var/run/docker.sock,
@@ -1172,27 +1173,8 @@ Then, you would use in your VNC client:
11721173
- Port 5901 to connect to the Edge container
11731174
- Port 5902 to connect to the Firefox container
11741175

1175-
If you get a prompt asking for a password, it is: `secret`. If you wish to change this, you should either change
1176-
it in the `/NodeBase/Dockerfile` and build the images yourself, or you can define a Docker image that derives from
1177-
the posted ones which reconfigures it:
1178-
1179-
Dockerfile example that extends the `node-chrome:4.9.0-20230421`. You can choose another browser image or a Standalone
1180-
browser image.
1181-
1182-
``` dockerfile
1183-
FROM selenium/node-chrome:4.9.0-20230421
1184-
1185-
RUN x11vnc -storepasswd <your-password-here> /home/seluser/.vnc/passwd
1186-
```
1187-
1188-
Save the `Dockerfile` as `DockerfileVNCPasswordChanged`, open a terminal and on the same directory run:
1189-
1190-
```shell
1191-
docker build -t selenium/node-chrome-vnc-password-changed:4.9.0-20230421 -f DockerfileVNCPasswordChanged .
1192-
```
1193-
1194-
And from now on, instead of using `node-chrome:4.9.0-20230421` in your scripts or docker-compose files, use
1195-
`selenium/node-chrome-vnc-password-changed:4.9.0-20230421`.
1176+
If you get a prompt asking for a password, it is: `secret`. If you wish to change this,
1177+
you can set the environment variable `SE_VNC_PASSWORD`.
11961178

11971179
If you want to run VNC without password authentication you can set the environment variable `SE_VNC_NO_PASSWORD=1`.
11981180

0 commit comments

Comments
 (0)