File tree Expand file tree Collapse file tree 2 files changed +13
-14
lines changed Expand file tree Collapse file tree 2 files changed +13
-14
lines changed Original file line number Diff line number Diff line change 1
- ENV DEBIAN_FRONTEND noninteractive
2
- ENV DEBCONF_NONINTERACTIVE_SEEN true
1
+ USER root
3
2
4
3
#==============
5
4
# VNC and Xvfb
@@ -10,14 +9,18 @@ RUN apt-get update -qqy \
10
9
xvfb \
11
10
&& rm -rf /var/lib/apt/lists/* /var/cache/apt/*
12
11
12
+ #===================================================
13
+ # Run the following commands as non-privileged user
14
+ #===================================================
15
+
16
+ USER seluser
17
+
13
18
#==============================
14
19
# Scripts to run Selenium Node
15
20
#==============================
16
- COPY \
17
- entry_point.sh \
21
+ COPY entry_point.sh \
18
22
functions.sh \
19
23
/opt/bin/
20
- RUN chmod +x /opt/bin/entry_point.sh
21
24
22
25
#============================
23
26
# Some configuration options
@@ -27,6 +30,4 @@ ENV SCREEN_HEIGHT 1020
27
30
ENV SCREEN_DEPTH 24
28
31
ENV DISPLAY :99.0
29
32
30
- USER seluser
31
-
32
33
CMD ["/opt/bin/entry_point.sh"]
Original file line number Diff line number Diff line change 1
1
#! /bin/bash
2
2
3
3
source /opt/bin/functions.sh
4
- /opt/selenium /generate_config > /opt /selenium/config.json
4
+ /opt/bin /generate_config > /home/seluser /selenium/config.json
5
5
6
6
export GEOMETRY=" $SCREEN_WIDTH " " x" " $SCREEN_HEIGHT " " x" " $SCREEN_DEPTH "
7
7
8
- if [ ! -e /opt /selenium/config.json ]; then
8
+ if [ ! -e /home/seluser /selenium/config.json ]; then
9
9
echo No Selenium Node configuration file, the node-base image is not intended to be run directly. 1>&2
10
10
exit 1
11
11
fi
@@ -29,19 +29,17 @@ if [ ! -z "$SE_OPTS" ]; then
29
29
echo " appending selenium options: ${SE_OPTS} "
30
30
fi
31
31
32
- # TODO: Look into http://www.seleniumhq.org/docs/05_selenium_rc.jsp#browser-side-logs
33
-
34
32
SERVERNUM=$( get_server_num)
35
33
36
34
rm -f /tmp/.X* lock
37
35
38
36
xvfb-run -n $SERVERNUM --server-args=" -screen 0 $GEOMETRY -ac +extension RANDR" \
39
- java ${JAVA_OPTS} -jar /opt /selenium/selenium-server-standalone.jar \
37
+ java ${JAVA_OPTS} -jar /home/seluser /selenium/selenium-server-standalone.jar \
40
38
-role node \
41
39
-hub http://$HUB_PORT_4444_TCP_ADDR :$HUB_PORT_4444_TCP_PORT /grid/register \
42
- -nodeConfig /opt /selenium/config.json \
40
+ -nodeConfig /home/seluser /selenium/config.json \
43
41
${SE_OPTS} &
44
42
NODE_PID=$!
45
43
46
44
trap shutdown SIGTERM SIGINT
47
- wait $NODE_PID
45
+ wait $NODE_PID
You can’t perform that action at this time.
0 commit comments