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

Commit

Permalink
Merge branch 'trunk' of https://github.com/SeleniumHQ/docker-selenium
Browse files Browse the repository at this point in the history
…into trunk
  • Loading branch information
jamesmortensen committed May 8, 2023
2 parents 4cd38d5 + 17ce8e3 commit 0c14b8b
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 29 deletions.
4 changes: 2 additions & 2 deletions Base/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -92,9 +92,9 @@ COPY supervisord.conf /etc
RUN mkdir -p /opt/selenium /opt/selenium/assets /var/run/supervisor /var/log/supervisor \
&& touch /opt/selenium/config.toml \
&& chmod -R 777 /opt/selenium /opt/selenium/assets /var/run/supervisor /var/log/supervisor /etc/passwd \
&& wget --no-verbose https://github.com/SeleniumHQ/selenium/releases/download/selenium-4.9.0/selenium-server-4.9.0.jar \
&& wget --no-verbose https://github.com/SeleniumHQ/selenium/releases/download/selenium-4.9.0/selenium-server-4.9.1.jar \
-O /opt/selenium/selenium-server.jar \
&& 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 \
&& 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 \
-O /opt/selenium/selenium-http-jdk-client.jar \
&& chgrp -R 0 /opt/selenium ${HOME} /opt/selenium/assets /var/run/supervisor /var/log/supervisor \
&& chmod -R g=u /opt/selenium ${HOME} /opt/selenium/assets /var/run/supervisor /var/log/supervisor \
Expand Down
6 changes: 6 additions & 0 deletions NodeBase/start-vnc.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,12 @@ if [ "${START_XVFB:-$SE_START_XVFB}" = true ] ; then
X11VNC_OPTS="${X11VNC_OPTS} -viewonly"
fi

VNC_PASSWORD=${VNC_PASSWORD:-$SE_VNC_PASSWORD}
if [ ! -z $VNC_PASSWORD ]; then
echo "Starting VNC server with custom password"
x11vnc -storepasswd ${VNC_PASSWORD} ${HOME}/.vnc/passwd
fi

for i in $(seq 1 10)
do
sleep 1
Expand Down
36 changes: 9 additions & 27 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -601,7 +601,8 @@ there, and when the test completes, the container gets thrown away.

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

### Configuration example

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

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

If you get a prompt asking for a password, it is: `secret`. If you wish to change this, you should either change
it in the `/NodeBase/Dockerfile` and build the images yourself, or you can define a Docker image that derives from
the posted ones which reconfigures it:

Dockerfile example that extends the `node-chrome:4.9.0-20230421`. You can choose another browser image or a Standalone
browser image.

``` dockerfile
FROM selenium/node-chrome:4.9.0-20230421

RUN x11vnc -storepasswd <your-password-here> /home/seluser/.vnc/passwd
```

Save the `Dockerfile` as `DockerfileVNCPasswordChanged`, open a terminal and on the same directory run:

```shell
docker build -t selenium/node-chrome-vnc-password-changed:4.9.0-20230421 -f DockerfileVNCPasswordChanged .
```

And from now on, instead of using `node-chrome:4.9.0-20230421` in your scripts or docker-compose files, use
`selenium/node-chrome-vnc-password-changed:4.9.0-20230421`.
If you get a prompt asking for a password, it is: `secret`. If you wish to change this,
you can set the environment variable `SE_VNC_PASSWORD`.

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

Expand Down

0 comments on commit 0c14b8b

Please sign in to comment.