Skip to content
This repository was archived by the owner on Jun 30, 2021. It is now read-only.

Commit a95b051

Browse files
committed
Support -e DEBUG=bash for local testing
1 parent 0d5caa7 commit a95b051

File tree

2 files changed

+26
-19
lines changed

2 files changed

+26
-19
lines changed

bin/entry.sh

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -469,7 +469,14 @@ env > env
469469
# export NORMAL_USER_UID="$(id -u seluser)"
470470
# export NORMAL_USER_GID="$(id -g seluser)"
471471
ga_track_start
472-
exec run-supervisord.sh
472+
473+
if [ "${DEBUG}" == "bash" ]; then
474+
run-supervisord.sh &
475+
cd /var/log/cont
476+
exec bash
477+
else
478+
exec run-supervisord.sh
479+
fi
473480

474481
# Note: sudo -i creates a login shell for someUser, which implies the following:
475482
# - someUser's user-specific shell profile, if defined, is loaded.

misc/misc.md

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ Miscellaneous internal notes, do not read!
22

33
## Build
44

5-
time (docker build -t elgalu/selenium . ;echo $?;beep)
6-
docker run --rm -ti --name=grid -e SELENIUM_HUB_PORT=4444 -p=4444:4444 -p=5900:25900 -e VIDEO=true -e VNC_PASSWORD=no --shm-size=1g elgalu/selenium
5+
time (docker build -t selenium . ;echo $?;beep)
6+
docker run --rm -ti --name=grid --privileged -e SELENIUM_HUB_PORT=4444 -p=4444:4444 -p=5900:25900 -e VIDEO=true -e CHROME=false -e FIREFOX=false --shm-size=1g selenium
77

88
### Wait
99
Wait and get versions
@@ -25,9 +25,9 @@ Push setup, first time only:
2525

2626
Build a grid with extra nodes
2727

28-
docker run --rm --name=grid -p 4444:24444 -p 5900:25900 --shm-size=1g -e VNC_PASSWORD=hola elgalu/selenium
28+
docker run --rm --name=grid -p 4444:24444 -p 5900:25900 --shm-size=1g -e VNC_PASSWORD=hola selenium
2929

30-
docker run --rm --name=node -e DISP_N=13 -e SSHD_PORT=22223 -e SUPERVISOR_HTTP_PORT=29003 -e VNC_PORT=25903 -e SELENIUM_NODE_CH_PORT=25330 -e SELENIUM_NODE_FF_PORT=25331 -e GRID=false -e CHROME=true -e FIREFOX=true --net=container elgalu/selenium
30+
docker run --rm --name=node -e DISP_N=13 -e SSHD_PORT=22223 -e SUPERVISOR_HTTP_PORT=29003 -e VNC_PORT=25903 -e SELENIUM_NODE_CH_PORT=25330 -e SELENIUM_NODE_FF_PORT=25331 -e GRID=false -e CHROME=true -e FIREFOX=true --net=container selenium
3131

3232
See logs
3333

@@ -54,22 +54,22 @@ List firefox versions via docker exe
5454

5555
## To update image id and digest
5656

57-
docker inspect -f='{{.Id}}' elgalu/selenium
57+
docker inspect -f='{{.Id}}' selenium
5858
docker images --digests
5959

6060
## Run with shared dir
6161

6262
docker run --rm --name=local -p=127.0.0.1:4460:24444 -p=127.0.0.1:5910:25900 \
63-
-v /e2e/uploads:/e2e/uploads elgalu/selenium
63+
-v /e2e/uploads:/e2e/uploads selenium
6464
docker run --rm --name=local -p=4460:24444 -p=5910:25900 \
65-
-v /var/run/docker.sock:/var/run/docker.sock -v $(which docker):$(which docker) elgalu/selenium
65+
-v /var/run/docker.sock:/var/run/docker.sock -v $(which docker):$(which docker) selenium
6666

6767

68-
docker run --rm --name=ff -p=127.0.0.1:4461:24444 -p=127.0.0.1:5911:25900 -v /e2e/uploads:/e2e/uploads elgalu/selenium
68+
docker run --rm --name=ff -p=127.0.0.1:4461:24444 -p=127.0.0.1:5911:25900 -v /e2e/uploads:/e2e/uploads selenium
6969

7070
## Run without shared dir and bind ports to all network interfaces
7171

72-
docker run -d --name=local -p=0.0.0.0:4444:24444 -p=0.0.0.0:5900:25900 elgalu/selenium:0.1
72+
docker run -d --name=local -p=0.0.0.0:4444:24444 -p=0.0.0.0:5900:25900 selenium:0.1
7373

7474
## Opening tunnels
7575

@@ -88,11 +88,11 @@ List firefox versions via docker exe
8888
## Run without dir and bind to all interfaces
8989
Note anything after the image will be taken as arguments for the cmd/entrypoint
9090

91-
docker run --rm --name=local -p=0.0.0.0:8813:8484 -p=0.0.0.0:2222:2222 -p=0.0.0.0:4470:24444 -p=0.0.0.0:5900:25900 -e SCREEN_WIDTH=1800 -e SCREEN_HEIGHT=1110 -e VNC_PASSWORD=hola -e SSH_AUTH_KEYS="$(cat ~/.ssh/id_rsa.pub)" elgalu/selenium
91+
docker run --rm --name=local -p=0.0.0.0:8813:8484 -p=0.0.0.0:2222:2222 -p=0.0.0.0:4470:24444 -p=0.0.0.0:5900:25900 -e SCREEN_WIDTH=1800 -e SCREEN_HEIGHT=1110 -e VNC_PASSWORD=hola -e SSH_AUTH_KEYS="$(cat ~/.ssh/id_rsa.pub)" selenium
9292

93-
docker run --rm --name=local -p=4470:24444 -p=5900:25900 -e VNC_PASSWORD=hola elgalu/selenium
94-
docker run --rm --name=local -p=4470:24444 -p=5900:25900 -e VNC_PASSWORD=hola docker.io/elgalu/selenium
95-
docker run --rm --name=local -p=0.0.0.0:4470:24444 -p=0.0.0.0:5900:25900 --add-host myserver.dev:172.17.42.1 elgalu/selenium
93+
docker run --rm --name=local -p=4470:24444 -p=5900:25900 -e VNC_PASSWORD=hola selenium
94+
docker run --rm --name=local -p=4470:24444 -p=5900:25900 -e VNC_PASSWORD=hola docker.io/selenium
95+
docker run --rm --name=local -p=0.0.0.0:4470:24444 -p=0.0.0.0:5900:25900 --add-host myserver.dev:172.17.42.1 selenium
9696

9797
However adding a custom host IP to server-selenium.local (e.g. bsele ssh config) is more work:
9898

@@ -101,18 +101,18 @@ However adding a custom host IP to server-selenium.local (e.g. bsele ssh config)
101101

102102
vncv localhost:5900 -Scaling=60% &
103103

104-
docker run --rm --name=ff -p=0.0.0.0:4471:24444 -p=0.0.0.0:5921:25900 elgalu/selenium
104+
docker run --rm --name=ff -p=0.0.0.0:4471:24444 -p=0.0.0.0:5921:25900 selenium
105105

106106
Automatic builds not working for me right now, maybe there is an issue with docker registry v1 vs v2
107107
https://registry.hub.docker.com/u/elgalu/docker-selenium/builds_history/31621/
108108

109109
## Pulling
110110

111-
docker pull registry.hub.docker.com/elgalu/selenium
111+
docker pull registry.hub.docker.com/selenium
112112

113113
## Pull
114114

115-
docker run -d --name=max -p=0.0.0.0:4411:24444 -p=0.0.0.0:5911:25900 elgalu/selenium
115+
docker run -d --name=max -p=0.0.0.0:4411:24444 -p=0.0.0.0:5911:25900 selenium
116116

117117
How to connect through vnc (need a vnc client)
118118

@@ -333,7 +333,7 @@ ANYPORT=0
333333
REMOTE_DOCKER_SRV=localhost
334334
CONTAINER=$(docker run -d -p=0.0.0.0:${ANYPORT}:22222 -p=0.0.0.0:${ANYPORT}:24444 \
335335
-p=0.0.0.0:${ANYPORT}:25900 -e SCREEN_HEIGHT=1110 -e VNC_PASSWORD=hola \
336-
-e SSH_AUTH_KEYS="$(cat ~/.ssh/id_rsa.pub)" elgalu/selenium
336+
-e SSH_AUTH_KEYS="$(cat ~/.ssh/id_rsa.pub)" selenium
337337
338338
# -- Option 2.docker run- Running docker on remote docker server like in the cloud
339339
# Useful if the docker server is running in the cloud. Establish free local ports
@@ -343,7 +343,7 @@ ssh ${REMOTE_DOCKER_SRV} #get into the remote docker provider somehow
343343
# it acts as a jump host so my public key is already on that server
344344
CONTAINER=$(docker run -d -p=0.0.0.0:${ANYPORT}:22222 -e SCREEN_HEIGHT=1110 \
345345
-e VNC_PASSWORD=hola -e SSH_AUTH_KEYS="$(cat ~/.ssh/authorized_keys)" \
346-
elgalu/selenium
346+
selenium
347347
348348
# -- Common: Wait for the container to start
349349
./host-scripts/wait-docker-selenium.sh grid 7s

0 commit comments

Comments
 (0)