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.
<h2id="official">Notes on similar repo: SeleniumHQ/docker-selenium</h2>
19
19
20
-
Note SeleniumHQ/docker-selenium project is more useful for building selenium grids while this one focuses on building disposable standalone seleniums with [video recording support](./docs/videos.md) and both browsers on the same container. It also adds some other features like [customizing the screen size](#screen-size) and [ssh access](#ssh) that can be particularly useful for tunneling support.
20
+
Note [SeleniumHQ/docker-selenium](https://github.com/SeleniumHQ/docker-selenium) project is more useful for building selenium grids while this one focuses on building disposable standalone seleniums with [video recording support](./docs/videos.md) and both browsers on the same container. It also adds some other features like [customizing the screen size](#screen-size) and [ssh access](#ssh) that can be particularly useful for tunneling support.
21
21
22
22
### Run
23
23
24
24
1. Pull the image and run the container
25
25
26
-
docker pull elgalu/selenium:2.53.0h
26
+
docker pull elgalu/selenium:2.53.0i
27
27
28
-
docker run --rm -ti --name=grid -p 4444:24444 -p 5920:25900 \
2. Wait until the grid starts properly before starting the tests _(Optional but recommended)_
32
32
33
33
docker exec grid wait_all_done 30s
34
34
35
35
After this, Selenium should be up and running at `http://localhost:4444/wd/hub`. Open the url in your browser to confirm it is running.
36
-
If you are using Mac (OSX) `localhost` won't work! Find out the correct IP through `boot2docker ip` or `docker-machine ip default`.
36
+
If you are using Mac (OSX) or [Microsoft Windows](https://docs.docker.com/engine/installation/windows/)`localhost` won't work! Find out the correct IP through `boot2docker ip` or `docker-machine ip default`.
37
37
38
38
**Notes:**
39
39
* Add `sudo` only if needed in your environment
@@ -58,21 +58,21 @@ or former:
58
58
59
59
You can also ssh into the machine as long as `SSH_AUTH_KEYS="$(cat ~/.ssh/id_rsa.pub)"` is correct.
60
60
61
-
docker run --rm -ti --name=grid -p=4444:24444 -p=5920:25900 -p=22222:22222 \
61
+
docker run --rm -ti --name=grid -p=4444:24444 -p=5900:25900 -p=22222:22222 \
Include `-X` in ssh command if you want to redirect the started GUI programs to your host, but for that you also need to pass `-e SSHD_X11FORWARDING=yes`
71
71
72
-
docker run --rm -ti --name=grid -p=4444:24444 -p=5920:25900 -p=22222:22222 \
72
+
docker run --rm -ti --name=grid -p=4444:24444 -p=5900:25900 -p=22222:22222 \
73
73
-e SSHD=true -e SSHD_X11FORWARDING=yes \
74
74
-e SSH_AUTH_KEYS="$(cat ~/.ssh/id_rsa.pub)" \
75
-
-v /dev/shm:/dev/shm elgalu/selenium:2.53.0h
75
+
-v /dev/shm:/dev/shm elgalu/selenium:2.53.0i
76
76
77
77
Then
78
78
@@ -90,16 +90,16 @@ Supervisor exposes an http server but is not enough to bind the ports via `docke
90
90
### Screen size
91
91
You can set a custom screen size at docker run time by providing `SCREEN_WIDTH` and `SCREEN_HEIGHT` environment variables:
92
92
93
-
docker pull elgalu/selenium:2.53.0h
93
+
docker pull elgalu/selenium:2.53.0i
94
94
95
-
docker run -d --name=grid -p 4444:24444 -p 5920:25900 \
95
+
docker run -d --name=grid -p 4444:24444 -p 5900:25900 \
96
96
-v /dev/shm:/dev/shm -e VNC_PASSWORD=hola \
97
97
-e SCREEN_WIDTH=1920 -e SCREEN_HEIGHT=1480 \
98
-
elgalu/selenium:2.53.0h
98
+
elgalu/selenium:2.53.0i
99
99
100
100
docker exec grid wait_all_done 10s
101
101
102
-
open vnc://:hola@localhost:5920
102
+
open vnc://:hola@localhost:5900
103
103
104
104
### Chrome flavor
105
105
@@ -112,7 +112,8 @@ To configure which Chrome flavor you want to use (stable, beta, unstable), just
112
112
This feature was available in previous versions, please go to [2.47.1m] to use it.
113
113
To configure which Firefox version to use, first check available versions in the [CHANGELOG](./CHANGELOG.md). Then pass `-e FIREFOX_VERSION=38.0.6` to `docker run`. Default is the latest number of the available list.
114
114
115
-
### Record Videos
115
+
<<h3id="video">Record Videos</h3>
116
+
116
117
Step by step guide at [docs/videos.md](./docs/videos.md)
117
118
118
119
If you create the container with `-e VIDEO=true` it will start recording a video through the vnc connection run upon start.
@@ -140,19 +141,19 @@ When you don't specify a VNC password, a random one will be generated. That pass
140
141
141
142
You can connect to see what's happening
142
143
143
-
open vnc://:ooGhai0aesaesh@localhost:5920
144
+
open vnc://:ooGhai0aesaesh@localhost:5900
144
145
145
146
### noVNC
146
147
147
148
Disabled by default, [noVNC](https://github.com/kanaka/noVNC) provides a browser VNC client so you don't need to install a vnc viewer if you choose so. *Note:* we were using guacamole before.
148
149
149
-
Safari Browser already comes with a built-in vnc viewer so this feature is overkill and is disabled by default, just navigate to vnc://localhost:5920 in your Safari browser.
150
+
Safari Browser already comes with a built-in vnc viewer so this feature is overkill and is disabled by default, just navigate to vnc://localhost:5900 in your Safari browser.
150
151
151
152
You need to pass the environment variable `-e NOVNC=true` in order to start the noVNC service and you will be able to open a browser at [localhost:6080](http://localhost:6080/vnc.html)
152
153
153
-
docker run --rm -ti --name=grid -p 4444:24444 -p 5920:25900 \
154
+
docker run --rm -ti --name=grid -p 4444:24444 -p 5900:25900 \
If the VNC password was randomly generated find out with
158
159
@@ -202,6 +203,8 @@ However this is now the default of this image, see `CHROME_ARGS="--no-sandbox"`
202
203
203
204
## Security
204
205
206
+
The docker images are built and pushed from [TravisCI](https://travis-ci.org/elgalu/docker-selenium/builds/123103275) for full traceability.
207
+
205
208
Do **NOT** expose your selenium grid to the outside world (e.g. in AWS), because Selenium does not provide auth. Therefore, if the ports are not firewalled malicious users will use [your selenium grid as a bot net](https://github.com/SeleniumHQ/docker-selenium/issues/147).
206
209
207
210
Put that firewall stuff aside, 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.
@@ -223,9 +226,9 @@ There are also additional steps you can take to ensure you're using the correct
223
226
224
227
You can simply verify that image id is indeed the correct one.
225
228
226
-
# e.g. full image id for tag 2.53.0h
229
+
# e.g. full image id for tag 2.53.0i
227
230
export IMGID="<<Please see CHANGELOG.md>>"
228
-
if docker inspect -f='{{.Id}}' elgalu/selenium:2.53.0h |grep ${IMGID} &> /dev/null; then
231
+
if docker inspect -f='{{.Id}}' elgalu/selenium:2.53.0i |grep ${IMGID} &> /dev/null; then
229
232
echo "Image ID tested ok"
230
233
else
231
234
echo "Image ID doesn't match"
@@ -235,7 +238,7 @@ You can simply verify that image id is indeed the correct one.
235
238
236
239
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:
@@ -370,7 +373,7 @@ If you git clone this repo locally, i.e. cd into where the Dockerfile is, you ca
370
373
371
374
If you prefer to download the final built image from docker you can pull it, personally I always prefer to build them manually except for the base images like Ubuntu 14.04.2:
372
375
373
-
docker pull elgalu/selenium:2.53.0h
376
+
docker pull elgalu/selenium:2.53.0i
374
377
375
378
### 2. Use this image
376
379
@@ -438,6 +441,7 @@ So `--pid=host` is included to avoid https://github.com/docker/docker/issues/589
0 commit comments