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
{{ message }}
This repository was archived by the owner on Jun 30, 2021. It is now read-only.
Copy file name to clipboardExpand all lines: README.md
+21-13Lines changed: 21 additions & 13 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -17,28 +17,24 @@ Note SeleniumHQ/docker-selenium project is more useful for building selenium gri
17
17
18
18
### One-liner Install & Usage
19
19
20
-
In general: add `sudo` only if needed in your environment and `--privileged` if you really need it.
20
+
In general: add `sudo` only if needed in your environment and `--privileged` if you really need it like when [Chrome crashes](https://github.com/elgalu/docker-selenium/issues/20) during your high gpu intensive tests.
21
21
22
-
sudo docker run --privileged -p 4444:24444 -p 5920:25900 \
23
-
-e VNC_PASSWORD=hola elgalu/selenium:2.47.1f
22
+
docker run --privileged -p 4444:24444 -p 5920:25900 \
23
+
-e VNC_PASSWORD=hola elgalu/selenium:2.47.1g
24
24
25
25
### Non-privileged
26
26
### Run
27
27
28
28
If your setup is correct, privileged mode and sudo should not be necessary:
29
29
30
-
docker run --rm --name=ch -p=0.0.0.0:4470:24444 -p=0.0.0.0:5920:25900 \
31
-
-p=0.0.0.0:2222:22222 -p=0.0.0.0:6080:26080 \
32
-
-e SCREEN_WIDTH=1920 -e SCREEN_HEIGHT=1080 \
33
-
-e VNC_PASSWORD=hola \
34
-
-e SSH_AUTH_KEYS="$(cat ~/.ssh/id_rsa.pub)" \
30
+
docker run --rm --name=ch -p=4444:24444 -p=5920:25900 \
35
31
elgalu/selenium:2.47.1f
36
32
37
33
Make sure `docker run` finishes with **selenium all done and ready for testing** else you won't be able to start your tests. To perform this check programatically please use this command where `ch` is the name of the container:
38
34
39
-
while ! docker exec ch grep 'all done and ready for testing' /var/log/sele/xterm-stdout.log > /dev/null 2>&1; do sleep 0.2; done
Selenium should be up and running at http://localhost:4470/wd/hub open the web page to confirm is running.
37
+
Selenium should be up and running at http://localhost:4444/wd/hub open the web page to confirm is running.
42
38
43
39
You can also ssh into the machine as long as `SSH_AUTH_KEYS="$(cat ~/.ssh/id_rsa.pub)"` is correct.
44
40
@@ -117,6 +113,18 @@ You can lunch a node only container via environment variables:
117
113
118
114
The important part above is `-e GRID=false` which tells the container to be a node-only node, this this case with 2 browsers `-e CHROME=true -e FIREFOX=true` but could be just 1.
119
115
116
+
## Chrome crashed
117
+
118
+
If your tests crashes in Chrome you may need to increase shm size:
119
+
120
+
1. start docker in privileged mode: `docker run --privileged`
121
+
2. increase shm size from default 64mb to something bigger:
A file [scm-source.json](./scm-source.json) is included at the root directory of the generated image with information that helps to comply with auditing requirements to trace the creation of this docker image.
@@ -139,7 +147,7 @@ There are also additional steps you can take to ensure you're using the correct
139
147
You can simply verify that image id is indeed the correct one.
if docker inspect -f='{{.Id}}' elgalu/selenium:2.47.1f |grep ${IMGID} &> /dev/null; then
144
152
echo "Image ID tested ok"
145
153
else
@@ -151,7 +159,7 @@ You can simply verify that image id is indeed the correct one.
151
159
Given docker.io currently allows to push the same tag image twice this represent a security concern but since docker >= 1.6.2 is possible to fetch the digest sha256 instead of the tag so you can be sure you're using the exact same docker image every time:
You can find all digests sha256 and image ids per tag in the [CHANGELOG](./CHANGELOG.md) so as of now you just need to trust the sha256 in the CHANGELOG. Bullet proof is to fork this project and build the images yourself if security is a big concern.
0 commit comments