Skip to content

Commit 33bd1ab

Browse files
authored
Update README.md (#1877)
Add disabling VNC info, fix typos
1 parent 2e0fb77 commit 33bd1ab

File tree

1 file changed

+41
-35
lines changed

1 file changed

+41
-35
lines changed

README.md

Lines changed: 41 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -73,15 +73,15 @@ docker run -d -p 4444:4444 -p 7900:7900 --shm-size="2g" selenium/standalone-fire
7373

7474
4. (Optional) To see what is happening inside the container, head to <http://localhost:7900/?autoconnect=1&resize=scale&password=secret>.
7575

76-
More details about visualising the container activity, check the [Debugging](#debugging) section.
76+
For more details about visualising the container activity, check the [Debugging](#debugging) section.
7777

7878
:point_up: When executing `docker run` for an image that contains a browser please use
7979
the flag `--shm-size=2g` to use the host's shared memory.
8080

8181
:point_up: Always use a Docker image with a full tag to pin a specific browser and Grid version.
8282
See [Tagging Conventions](https://github.com/SeleniumHQ/docker-selenium/wiki/Tagging-Convention) for details.
8383

84-
### Try them out in a ready to use GitPod environment!
84+
### Try them out in a ready-to-use GitPod environment!
8585

8686
[![Open in Gitpod](https://gitpod.io/button/open-in-gitpod.svg)](https://gitpod.io/#https://github.com/SeleniumHQ/docker-selenium)
8787

@@ -90,7 +90,7 @@ ___
9090
## Experimental Mult-Arch aarch64/armhf/amd64 Images
9191

9292
For experimental docker container images, which run on platforms such as the Mac M1 or Raspberry Pi,
93-
see the community driven repository hosted at
93+
see the community-driven repository hosted at
9494
[seleniumhq-community/docker-seleniarm](https://github.com/seleniumhq-community/docker-seleniarm).
9595
These images are built for three separate architectures: linux/arm64 (aarch64), linux/arm/v7 (armhf),
9696
and linux/amd64.
@@ -446,7 +446,7 @@ $ docker run -d -p 5556:5556 `
446446

447447
#### Docker Compose
448448
[Docker Compose](https://docs.docker.com/compose/) is the simplest way to start a Grid. Use the
449-
linked resources below, save them locally, and check the execution instructions on top of each file.
449+
linked resources below, save them locally and check the execution instructions on top of each file.
450450

451451
##### Version 2
452452
[`docker-compose-v2.yml`](docker-compose-v2.yml)
@@ -477,7 +477,7 @@ Tests execution can be recorded by using the `selenium/video:ffmpeg-4.3.1-202306
477477
Docker image. One container is needed per each container where a browser is running. This means if you are
478478
running 5 Nodes/Standalone containers, you will need 5 video containers, the mapping is 1-1.
479479

480-
Currently, the only way to do this mapping is manually (either starting the containers manually, or through
480+
Currently, the only way to do this mapping is manually (either starting the containers manually or through
481481
`docker-compose`). We are iterating on this process and probably this setup will be more simple in the future.
482482

483483
The video Docker image we provide is based on the ffmpeg Ubuntu image provided by the
@@ -758,15 +758,15 @@ ___
758758

759759
### SE_OPTS Selenium Configuration Options
760760

761-
You can pass `SE_OPTS` variable with additional commandline parameters for starting a hub or a node.
761+
You can pass `SE_OPTS` variable with additional command line parameters for starting a hub or a node.
762762

763763
``` bash
764764
$ docker run -d -p 4444:4444 -e SE_OPTS="--log-level FINE" --name selenium-hub selenium/hub:4.10.0-20230607
765765
```
766766

767767
### SE_JAVA_OPTS Java Environment Options
768768

769-
You can pass `SE_JAVA_OPTS` environment variable to java process.
769+
You can pass `SE_JAVA_OPTS` environment variable to the Java process.
770770

771771
``` bash
772772
$ docker run -d -p 4444:4444 -e SE_JAVA_OPTS=-Xmx512m --name selenium-hub selenium/hub:4.10.0-20230607
@@ -782,7 +782,7 @@ In both cases, it is necessary to tell the Node where the Event Bus is, so it ca
782782
the purpose of the `SE_EVENT_BUS_HOST`, `SE_EVENT_BUS_PUBLISH_PORT` and `SE_EVENT_BUS_SUBSCRIBE_PORT` environment
783783
variables.
784784

785-
In some cases, for example if you want to tag a node, it might be necessary to supply a custom stereotype to the node config. The environement variable `SE_NODE_STEREOTYPE`
785+
In some cases, for example, if you want to tag a node, it might be necessary to supply a custom stereotype to the node config. The environment variable `SE_NODE_STEREOTYPE`
786786
sets the stereotype entry in the node's `config.toml`. An example config.toml file can be found here: [Setting custom capabilities for matching specific Nodes](https://www.selenium.dev/documentation/grid/configuration/toml_options/#setting-custom-capabilities-for-matching-specific-nodes).
787787

788788
Here is an example with the default values of these environment variables:
@@ -796,7 +796,7 @@ $ docker run -d \
796796

797797
### Setting Sub Path
798798

799-
By default, Selenium is reachable at `http://127.0.0.1:4444/`. Selenium can be configured to use a custom sub path by specifying the `SE_SUB_PATH`
799+
By default, Selenium is reachable at `http://127.0.0.1:4444/`. Selenium can be configured to use a custom subpath by specifying the `SE_SUB_PATH`
800800
environmental variable. In the example below Selenium is reachable at `http://127.0.0.1:4444/selenium-grid/`
801801

802802
```bash
@@ -815,20 +815,20 @@ docker run -d -e SE_SCREEN_WIDTH=1366 -e SE_SCREEN_HEIGHT=768 -e SE_SCREEN_DEPTH
815815

816816
### Grid Url and Session Timeout
817817

818-
In some use cases you might need to set the Grid url to the Node, for example if you'd like to access the BiDi/CDP endpoint.
818+
In some use cases, you might need to set the Grid URL to the Node, for example, if you'd like to access the BiDi/CDP endpoint.
819819
This is also needed when you want to use the new `RemoteWebDriver.builder()` or `Augmenter()` present in Selenium 4
820820
(since they setup the BiDi/CDP connection implicitly). You can do that through the `SE_NODE_GRID_URL` environment
821821
variable. Setting this env var is needed if you want to see the live view while sessions are executing.
822822

823-
Grid has a default session timeout of 300 seconds, where the session can be on a stale state until it is killed. You can use
823+
Grid has a default session timeout of 300 seconds, where the session can be in a stale state until it is killed. You can use
824824
`SE_NODE_SESSION_TIMEOUT` to overwrite that value in seconds.
825825

826826

827827
### Session request timeout
828828

829829
A new session request is placed in the Session Queue before it is processed, and the request sits in the queue until a matching
830830
slot is found across the registered Nodes. However, the new session request might timeout if no slot was found. By default, a
831-
request will stay in the queue up to 300 seconds before it a timeout is reached. In addition, an attempt to process the request
831+
request will stay in the queue for up to 300 seconds before it a timeout is reached. In addition, an attempt to process the request
832832
is done every 5 seconds (by default).
833833

834834
It is possible to override those values through environment variables in the Hub and the SessionQueue (`SE_SESSION_REQUEST_TIMEOUT`
@@ -846,7 +846,7 @@ override the maximum limit by setting both `SE_NODE_MAX_SESSIONS` to a desired n
846846
`true`. Nevertheless, running more browser sessions than the available processors is not recommended since you will be overloading
847847
the resources.
848848

849-
Overriding this setting has a undesired side effect when video recording is enabled, since more than one browser session might be
849+
Overriding this setting has an undesired side effect when video recording is enabled since more than one browser session might be
850850
captured in the same video.
851851

852852
### Running in Headless mode
@@ -876,7 +876,7 @@ a value higher than zero to enable this behaviour.
876876
$ docker run -e SE_DRAIN_AFTER_SESSION_COUNT=5 --shm-size="2g" selenium/standalone-firefox:4.10.0-20230607
877877
```
878878

879-
With the previous command, the Standalone container will shutdown after 5 sessions have been executed.
879+
With the previous command, the Standalone container will shut down after 5 sessions have been executed.
880880

881881
___
882882

@@ -888,7 +888,7 @@ Clone the repo and from the project directory root you can build everything by r
888888
$ VERSION=local make build
889889
```
890890

891-
If you need to configure environment variable in order to build the image (http proxy for instance),
891+
If you need to configure environment variables in order to build the image (http proxy for instance),
892892
simply set an environment variable `BUILD_ARGS` that contains the additional variables to pass to the
893893
docker context (this will only work with docker >= 1.9)
894894

@@ -905,7 +905,7 @@ ___
905905

906906
It is a good practice to check first if the Grid is up and ready to receive requests, this can be done by checking the `/wd/hub/status` endpoint.
907907

908-
A Grid that is ready, composed by a hub and two nodes, could look like this:
908+
A Grid that is ready, composed of a hub and two nodes, could look like this:
909909

910910
```json
911911
{
@@ -983,7 +983,7 @@ $ docker run -d --net grid -e SE_EVENT_BUS_HOST=selenium-hub \
983983
selenium/node-firefox:4.10.0-20230607
984984

985985
```
986-
**Note:** The `\` line delimiter won't work on Windows based terminals, try either `^` or a backtick.
986+
**Note:** The `\` line delimiter won't work on Windows-based terminals, try either `^` or a backtick.
987987

988988
The container health status can be checked by doing `docker ps` and verifying the `(healthy)|(unhealthy)` status or by
989989
inspecting it in the following way:
@@ -1032,12 +1032,12 @@ Like this, the script will poll until the Grid is ready, and then your tests wil
10321032

10331033
___
10341034

1035-
## Install certificates for Chromium based browsers
1035+
## Install certificates for Chromium-based browsers
10361036

1037-
If you need to install custom certificates, CA, intermediate CA, client certificates (for example enterprise internal CA)
1038-
you can use the different utils come from libnss3-tools.
1039-
Chromium based browser uses nssdb as certificate store.
1040-
Create new nssdb:
1037+
If you need to install custom certificates, CA, intermediate CA, or client certificates (for example enterprise internal CA)
1038+
you can use the different utils that come from libnss3-tools.
1039+
The chromium-based browser uses nssdb as a certificate store.
1040+
Create a new nssdb:
10411041
```bash
10421042
certutil -d sql:$HOME/.pki/nssdb -N
10431043
```
@@ -1051,7 +1051,7 @@ certutil -d sql:$HOME/.pki/nssdb -A -t ",," -n <certificate nickname> -i <certif
10511051
```
10521052
You can find more information [here](https://chromium.googlesource.com/chromium/src/+/master/docs/linux/cert_management.md)
10531053
Usage example:
1054-
If your company has internal CA you can create your own dockerimage from selenium node image.
1054+
If your company has an internal CA you can create your own dockerimage from selenium node image.
10551055
You can then install all required internal certificates in your Dockerfile like this:
10561056
```bash
10571057
FROM selenium/node-edge:latest
@@ -1082,15 +1082,15 @@ As an alternative, you can add your certificate files to existing Selenium image
10821082
assumes you have a known image to use as a build image and have a way to publish new images to your local
10831083
docker registry.
10841084

1085-
This example uses a RedHat based distro as build image (Rocky Linux) but it can be *any* linux image of your choice.
1086-
Please note that build instrutions will vary between distributions. You can check instructions for Ubuntu
1087-
in previous example.
1085+
This example uses a RedHat-based distro as a build image (Rocky Linux) but it can be *any* Linux image of your choice.
1086+
Please note that build instruction will vary between distributions. You can check the instructions for Ubuntu
1087+
in the previous example.
10881088

10891089
The example also assumes your internal CA is already in */etc/pki/ca-trust/source/anchors/YOUR_CA.pem*,
10901090
the default location for Rocky Linux. Alternatively, you can also provide these files from your host and
1091-
copy them into build image.
1091+
copy them into the build image.
10921092

1093-
For Chrome and Edge browsers, the recipe is the same, just adapt image name (node-chrome or node-edge):
1093+
For Chrome and Edge browsers, the recipe is the same, just adapt the image name (node-chrome or node-edge):
10941094
```
10951095
# Get a standard image for creating nssdb file
10961096
FROM rockylinux:8.6 as build
@@ -1126,7 +1126,7 @@ ___
11261126

11271127
## Debugging
11281128

1129-
This project uses [x11vnc](https://github.com/LibVNC/x11vnc) as VNC server to allow users inspect what is happening
1129+
This project uses [x11vnc](https://github.com/LibVNC/x11vnc) as a VNC server to allow users to inspect what is happening
11301130
inside the container. Users can connect to this server in two ways:
11311131

11321132
### Using a VNC client
@@ -1158,8 +1158,8 @@ If you want to run VNC in view-only mode you can set the environment variable `S
11581158

11591159
### Using your browser (no VNC client is needed)
11601160

1161-
This project uses [noVNC](https://github.com/novnc/noVNC) to allow users inspect visually container activity with
1162-
their browser. This might come handy if you cannot install a VNC client on your machine. Port 7900 is used to start
1161+
This project uses [noVNC](https://github.com/novnc/noVNC) to allow users to inspect visually container activity with
1162+
their browser. This might come in handy if you cannot install a VNC client on your machine. Port 7900 is used to start
11631163
noVNC, so you will need to connect to that port with your browser.
11641164

11651165
Similarly to the previous section, feel free to map port 7900 to any free external port that you wish.
@@ -1179,11 +1179,17 @@ Then, you would use in your browser:
11791179

11801180
If you get a prompt asking for a password, it is: `secret`.
11811181

1182+
### Disabling VNC
1183+
If You are running low on resources, or simply don't need to inspect running sessions, it is possible to not run VNC at all.
1184+
Just set
1185+
```SE_START_VNC=false```
1186+
environment variable on the grid startup.
1187+
11821188
___
11831189

11841190
## Tracing in Grid
11851191

1186-
In order to enable tracing in Selenium Grid container, the following commands can be executed:
1192+
In order to enable tracing in the Selenium Grid container, the following commands can be executed:
11871193

11881194
```bash
11891195
docker network create grid
@@ -1261,7 +1267,7 @@ A common scenario is mounting a volume to the browser
12611267
container in order to retrieve downloaded files. This
12621268
works well in Windows and macOS but not without
12631269
workarounds in Linux. For more details, check this
1264-
well documented [issue](https://github.com/SeleniumHQ/docker-selenium/issues/1095).
1270+
well-documented [issue](https://github.com/SeleniumHQ/docker-selenium/issues/1095).
12651271

12661272
For example, while using Linux, you might be starting a
12671273
container in the following way:
@@ -1275,12 +1281,12 @@ docker run -d -p 4444:4444 --shm-size="2g" \
12751281
That will mount the host `/home/ubuntu/files` directory
12761282
to the `/home/seluser/files` inside the container. The
12771283
problem happens because the volume will be mounted as
1278-
`root`, and therefore the browser cannot write a file to
1284+
`root`; therefore, the browser cannot write a file to
12791285
that directory because it is running under the user
12801286
`seluser`. This happens because that is how Docker mounts
12811287
volumes in Linux, more details in this [issue](https://github.com/moby/moby/issues/2259).
12821288

1283-
A workaround for this is to create the directory on the
1289+
A workaround for this is to create a directory on the
12841290
host and change its permissions **before mounting the volume**.
12851291
Depending on your user permissions, you might need to use
12861292
`sudo` for some of these commands:

0 commit comments

Comments
 (0)