@@ -602,7 +602,8 @@ variables.
602
602
Here is an example with the default values of these environment variables:
603
603
604
604
` ` ` bash
605
- $ docker run -d -e SE_EVENT_BUS_HOST=< event_bus_ip| event_bus_name> -e SE_EVENT_BUS_PUBLISH_PORT=4442 -e SE_EVENT_BUS_SUBSCRIBE_PORT=4443 --shm-size=" 2g" selenium/node-chrome:4.1.3-20220427
605
+ $ docker run -d -e SE_EVENT_BUS_HOST=< event_bus_ip| event_bus_name> -e SE_EVENT_BUS_PUBLISH_PORT=4442 \
606
+ -e SE_EVENT_BUS_SUBSCRIBE_PORT=4443 --shm-size=" 2g" selenium/node-chrome:4.1.3-20220427
606
607
` ` `
607
608
608
609
# ## Setting Screen Resolution
@@ -612,7 +613,7 @@ These settings can be adjusted by specifying `SCREEN_WIDTH`, `SCREEN_HEIGHT`, `S
612
613
environmental variables when starting the container.
613
614
614
615
` ` ` bash
615
- docker run -d -e SCREEN_WIDTH=1366 -e SCREEN_HEIGHT=768 -e SCREEN_DEPTH=24 -e SCREEN_DPI=74 selenium/standalone-firefox
616
+ docker run -d -e SCREEN_WIDTH=1366 -e SCREEN_HEIGHT=768 -e SCREEN_DEPTH=24 -e SCREEN_DPI=74 selenium/standalone-firefox:4.1.3-20220427
616
617
` ` `
617
618
618
619
# ## Grid Url and Session Timeout
@@ -661,10 +662,25 @@ To avoid starting the server you can set the `START_XVFB` environment variable t
661
662
(or any other value than ` true` ), for example:
662
663
663
664
` ` ` bash
664
- $ docker run -d --net grid -e SE_EVENT_BUS_HOST=selenium-hub -e SE_EVENT_BUS_PUBLISH_PORT=4442 -e SE_EVENT_BUS_SUBSCRIBE_PORT=4443 -e START_XVFB=false --shm-size=" 2g" selenium/node-chrome
665
+ $ docker run -d --net grid -e SE_EVENT_BUS_HOST=selenium-hub -e SE_EVENT_BUS_PUBLISH_PORT=4442 \
666
+ -e SE_EVENT_BUS_SUBSCRIBE_PORT=4443 -e START_XVFB=false --shm-size=" 2g" selenium/node-chrome:4.1.3-20220427
665
667
` ` `
666
668
667
669
For more information, see this GitHub [issue](https://github.com/SeleniumHQ/docker-selenium/issues/567).
670
+
671
+ # ## Stopping the Node/Standalone after N sessions have been executed
672
+
673
+ In some environments, like Docker Swarm or Kubernetes, it is useful to shut down the Node or Standalone
674
+ container after N tests have been executed. For example, this can be used in Kubernetes to terminate the
675
+ pod and then scale a new one after N sessions. Set the environment variable ` DRAIN_AFTER_SESSION_COUNT` to
676
+ a value higher than zero to enable this behaviour.
677
+
678
+ ` ` ` bash
679
+ $ docker run -e DRAIN_AFTER_SESSION_COUNT=5 --shm-size=" 2g" selenium/standalone-firefox:4.1.3-20220427
680
+ ` ` `
681
+
682
+ With the previous command, the Standalone container will shutdown after 5 sessions have been executed.
683
+
668
684
___
669
685
670
686
# # Building the images
0 commit comments