@@ -602,7 +602,8 @@ variables.
602602Here is an example with the default values of these environment variables:
603603
604604` ` ` 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
606607` ` `
607608
608609# ## Setting Screen Resolution
@@ -612,7 +613,7 @@ These settings can be adjusted by specifying `SCREEN_WIDTH`, `SCREEN_HEIGHT`, `S
612613environmental variables when starting the container.
613614
614615` ` ` 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
616617` ` `
617618
618619# ## Grid Url and Session Timeout
@@ -661,10 +662,25 @@ To avoid starting the server you can set the `START_XVFB` environment variable t
661662(or any other value than ` true` ), for example:
662663
663664` ` ` 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
665667` ` `
666668
667669For 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+
668684___
669685
670686# # Building the images
0 commit comments