You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
-__selenium/base__: Base image which includes Java runtime and Selenium JAR file
16
-
-__selenium/hub__: Image for running a Selenium Grid Hub
17
-
-__selenium/node-base__: Base image for Selenium Grid Nodes which includes a virtual desktop environment and VNC support
18
-
-__selenium/node-chrome__: Selenium node with Chrome installed, needs to be connected to a Selenium Grid Hub
19
-
-__selenium/node-firefox__: Selenium node with Firefox installed, needs to be connected to a Selenium Grid Hub
20
-
-__selenium/standalone-chrome__: Selenium standalone with Chrome installed
21
-
-__selenium/standalone-firefox__: Selenium standalone with Firefox installed
22
-
-__selenium/standalone-chrome-debug__: Selenium standalone with Chrome installed and runs a VNC server
23
-
-__selenium/standalone-firefox-debug__: Selenium standalone with Firefox installed and runs a VNC server
24
-
-__selenium/node-chrome-debug__: Selenium node with Chrome installed and runs a VNC server, needs to be connected to a Selenium Grid Hub
25
-
-__selenium/node-firefox-debug__: Selenium node with Firefox installed and runs a VNC server, needs to be connected to a Selenium Grid Hub
15
+
-__selenium/base__: Base image which includes Java runtime and Selenium Server JAR file
16
+
-__selenium/hub__: Image for running a Grid Hub
17
+
-__selenium/node-base__: Base image for Grid Nodes which includes a virtual desktop environment
18
+
-__selenium/node-chrome__: Grid Node with Chrome installed, needs to be connected to a Grid Hub
19
+
-__selenium/node-firefox__: Grid Node with Firefox installed, needs to be connected to a Grid Hub
20
+
-__selenium/node-chrome-debug__: Grid Node with Chrome installed and runs a VNC server, needs to be connected to a Grid Hub
21
+
-__selenium/node-firefox-debug__: Grid Node with Firefox installed and runs a VNC server, needs to be connected to a Grid Hub
22
+
-__selenium/standalone-chrome__: Selenium Standalone with Chrome installed
23
+
-__selenium/standalone-firefox__: Selenium Standalone with Firefox installed
24
+
-__selenium/standalone-chrome-debug__: Selenium Standalone with Chrome installed and runs a VNC server
25
+
-__selenium/standalone-firefox-debug__: Selenium Standalone with Firefox installed and runs a VNC server
26
26
27
27
##
28
28
29
29
## Running the images
30
+
:exclamation: When executing `docker run` for an image with Chrome or Firefox please either mount `-v /dev/shm:/dev/shm` or use the flag `--shm-size=2g` to use the host's shared memory.
30
31
31
-
When executing docker run for an image with chrome browser please add volume mount `-v /dev/shm:/dev/shm` to use the host's shared memory.
32
-
32
+
Chrome
33
33
```bash
34
34
$ docker run -d -p 4444:4444 -v /dev/shm:/dev/shm selenium/standalone-chrome:3.8.1-bohrium
35
+
#OR
36
+
$ docker run -d -p 4444:4444 --shm-size=2g selenium/standalone-chrome:3.8.1-bohrium
35
37
```
36
-
37
-
This is a workaround to node-chrome crash in docker container issue: https://code.google.com/p/chromium/issues/detail?id=519952
38
-
39
-
When executing docker run for an image with firefox browser please set shm-size to 2g.
40
-
38
+
Firefox
41
39
```bash
40
+
$ docker run -d -p 4444:4444 -v /dev/shm:/dev/shm selenium/standalone-firefox:3.8.1-bohrium
41
+
#OR
42
42
$ docker run -d -p 4444:4444 --shm-size 2g selenium/standalone-firefox:3.8.1-bohrium
43
43
```
44
-
45
-
This is a workaround to node-firefox crash in docker container issue: https://bugzilla.mozilla.org/show_bug.cgi?id=1338771#c10
44
+
This is a known workaround to avoid the browser crashing inside a docker container, here are the documented issues for [Chrome](https://code.google.com/p/chromium/issues/detail?id=519952) and [Firefox](https://bugzilla.mozilla.org/show_bug.cgi?id=1338771#c10). The shm size of 2gb is arbitrary but known to work well, your specific use case might need a different value, it is recommended to tune this value according to your needs. Along the examples `-v /dev/shm:/dev/shm` will be used, but both are known to work.
46
45
47
46
48
47
### Standalone Chrome and Firefox
49
48
50
49
```bash
51
-
$ docker run -d -p 4444:4444 selenium/standalone-chrome:3.8.1-bohrium
50
+
$ docker run -d -p 4444:4444 -v /dev/shm:/dev/shm selenium/standalone-chrome:3.8.1-bohrium
52
51
# OR
53
-
$ docker run -d -p 4444:4444 selenium/standalone-firefox:3.8.1-bohrium
52
+
$ docker run -d -p 4444:4444 -v /dev/shm:/dev/shm selenium/standalone-firefox:3.8.1-bohrium
54
53
```
55
54
56
55
_Note: Only one standalone image can run on port_`4444`_at a time._
@@ -61,8 +60,8 @@ To inspect visually what the browser is doing use the `standalone-chrome-debug`
61
60
62
61
```bash
63
62
$ docker run -d -p 4444:4444 --name selenium-hub selenium/hub:3.8.1-bohrium
64
-
$ docker run -d --link selenium-hub:hub selenium/node-chrome:3.8.1-bohrium
65
-
$ docker run -d --link selenium-hub:hub selenium/node-firefox:3.8.1-bohrium
63
+
$ docker run -d --link selenium-hub:hub -v /dev/shm:/dev/shm selenium/node-chrome:3.8.1-bohrium
64
+
$ docker run -d --link selenium-hub:hub -v /dev/shm:/dev/shm selenium/node-firefox:3.8.1-bohrium
66
65
```
67
66
68
67
## Configuring the containers
@@ -89,7 +88,7 @@ You can pass `HUB_PORT_4444_TCP_ADDR` and `HUB_PORT_4444_TCP_PORT` options to pr
_Note: Since a Docker container is not meant to preserve state and spawning a new one takes less than 3 seconds you will likely want to remove containers after each end-to-end test with_`--rm`_command. You need to think of your Docker containers as single processes, not as running virtual machines, in case you are familiar with [Vagrant](https://www.vagrantup.com/)._
136
137
137
138
## Debugging
138
139
139
-
In the event you wish to visually see what the browser is doing you will want to run the `debug` variant of node or standalone images. A VNC server will run on port 5900. You are free to map that to any free external port that you wish. Example: <port4VNC>: 5900) you will only be able to run 1 node per port so if you wish to include a second node, or more, you will have to use different ports, the 5900 as the internal port will have to remain the same though as thats the VNC service on the node. The second example below shows how to run multiple nodes and with different VNC ports open:
140
+
In the event you wish to visually see what the browser is doing you will want to run the `debug` variant of node or standalone images. A VNC server will run on port 5900. You are free to map that to any free external port that you wish. Keep in mind that you will only be able to run one node per port so if you wish to include a second node, or more, you will have to use different ports, the 5900 as the internal port will have to remain the same though as thats the VNC service on the node. The second example below shows how to run multiple nodes and with different VNC ports open:
140
141
```bash
141
-
$ docker run -d -P -p <port4VNC>:5900 --link selenium-hub:hub selenium/node-chrome-debug:3.8.1-bohrium
142
-
$ docker run -d -P -p <port4VNC>:5900 --link selenium-hub:hub selenium/node-firefox-debug:3.8.1-bohrium
0 commit comments