File tree Expand file tree Collapse file tree 8 files changed +23
-21
lines changed
Expand file tree Collapse file tree 8 files changed +23
-21
lines changed Original file line number Diff line number Diff line change @@ -50,12 +50,12 @@ RUN useradd seluser \
5050# Run the following commands as non-privileged user
5151# ===================================================
5252USER seluser
53- WORKDIR /home/seluser
5453
5554# ==========
5655# Selenium
5756# ==========
58- RUN mkdir -p /home/seluser/selenium \
57+ RUN sudo mkdir -p /opt/selenium \
58+ && sudo chown seluser:seluser /opt/selenium \
5959 && wget --no-verbose https://selenium-release.storage.googleapis.com/3.4/selenium-server-standalone-3.4.0.jar \
60- -O /home/seluser /selenium/selenium-server-standalone.jar
60+ -O /opt /selenium/selenium-server-standalone.jar
6161
Original file line number Diff line number Diff line change @@ -29,6 +29,6 @@ COPY generate_config \
2929# Running this command as sudo just to avoid the message:
3030# To run a command as administrator (user "root"), use "sudo <command>". See "man sudo_root" for details.
3131# When logging into the container
32- RUN sudo /opt/bin/generate_config > /home/seluser /selenium/config.json
32+ RUN sudo /opt/bin/generate_config > /opt /selenium/config.json
3333
3434CMD ["/opt/bin/entry_point.sh"]
Original file line number Diff line number Diff line change 11#! /bin/bash
22
3- ROOT=/home/seluser /selenium
3+ ROOT=/opt /selenium
44CONF=$ROOT /config.json
55
66/opt/bin/generate_config > $CONF
@@ -19,7 +19,7 @@ function shutdown {
1919 echo " shutdown complete"
2020}
2121
22- java ${JAVA_OPTS} -jar /home/seluser /selenium/selenium-server-standalone.jar \
22+ java ${JAVA_OPTS} -jar /opt /selenium/selenium-server-standalone.jar \
2323 -role hub \
2424 -hubConfig $CONF \
2525 ${SE_OPTS} &
Original file line number Diff line number Diff line change 11#! /bin/bash
22
33source /opt/bin/functions.sh
4- /opt/bin/generate_config > /home/seluser /selenium/config.json
4+ /opt/bin/generate_config > /opt /selenium/config.json
55
66export GEOMETRY=" $SCREEN_WIDTH " " x" " $SCREEN_HEIGHT " " x" " $SCREEN_DEPTH "
77
8- if [ ! -e /home/seluser /selenium/config.json ]; then
8+ if [ ! -e /opt /selenium/config.json ]; then
99 echo No Selenium Node configuration file, the node-base image is not intended to be run directly. 1>&2
1010 exit 1
1111fi
@@ -34,10 +34,10 @@ SERVERNUM=$(get_server_num)
3434rm -f /tmp/.X* lock
3535
3636xvfb-run -n $SERVERNUM --server-args=" -screen 0 $GEOMETRY -ac +extension RANDR" \
37- java ${JAVA_OPTS} -jar /home/seluser /selenium/selenium-server-standalone.jar \
37+ java ${JAVA_OPTS} -jar /opt /selenium/selenium-server-standalone.jar \
3838 -role node \
3939 -hub http://$HUB_PORT_4444_TCP_ADDR :$HUB_PORT_4444_TCP_PORT /grid/register \
40- -nodeConfig /home/seluser /selenium/config.json \
40+ -nodeConfig /opt /selenium/config.json \
4141 ${SE_OPTS} &
4242NODE_PID=$!
4343
Original file line number Diff line number Diff line change @@ -26,12 +26,12 @@ USER seluser
2626#==================
2727ARG CHROME_DRIVER_VERSION=2.29
2828RUN wget --no-verbose -O /tmp/chromedriver_linux64.zip https://chromedriver.storage.googleapis.com/$CHROME_DRIVER_VERSION/chromedriver_linux64.zip \
29- && rm -rf /home/seluser /selenium/chromedriver \
30- && unzip /tmp/chromedriver_linux64.zip -d /home/seluser /selenium \
29+ && rm -rf /opt /selenium/chromedriver \
30+ && unzip /tmp/chromedriver_linux64.zip -d /opt /selenium \
3131 && rm /tmp/chromedriver_linux64.zip \
32- && mv /home/seluser/ selenium/chromedriver /home/seluser /selenium/chromedriver-$CHROME_DRIVER_VERSION \
33- && chmod 755 /home/seluser /selenium/chromedriver-$CHROME_DRIVER_VERSION \
34- && sudo ln -fs /home/seluser /selenium/chromedriver-$CHROME_DRIVER_VERSION /usr/bin/chromedriver
32+ && mv /opt/ selenium/chromedriver /opt /selenium/chromedriver-$CHROME_DRIVER_VERSION \
33+ && chmod 755 /opt /selenium/chromedriver-$CHROME_DRIVER_VERSION \
34+ && sudo ln -fs /opt /selenium/chromedriver-$CHROME_DRIVER_VERSION /usr/bin/chromedriver
3535
3636COPY generate_config /opt/bin/generate_config
3737
Original file line number Diff line number Diff line change 33# IMPORTANT: Change this file only in directory NodeDebug!
44
55source /opt/bin/functions.sh
6- /opt/bin/generate_config > /home/seluser /selenium/config.json
6+ /opt/bin/generate_config > /opt /selenium/config.json
77
88export GEOMETRY=" $SCREEN_WIDTH " " x" " $SCREEN_HEIGHT " " x" " $SCREEN_DEPTH "
99
10- if [ ! -e /home/seluser /selenium/config.json ]; then
10+ if [ ! -e /opt /selenium/config.json ]; then
1111 echo No Selenium Node configuration file, the node-base image is not intended to be run directly. 1>&2
1212 exit 1
1313fi
@@ -37,10 +37,10 @@ rm -f /tmp/.X*lock
3737
3838DISPLAY=$DISPLAY \
3939 xvfb-run -n $SERVERNUM --server-args=" -screen 0 $GEOMETRY -ac +extension RANDR" \
40- java ${JAVA_OPTS} -jar /home/seluser /selenium/selenium-server-standalone.jar \
40+ java ${JAVA_OPTS} -jar /opt /selenium/selenium-server-standalone.jar \
4141 -role node \
4242 -hub http://$HUB_PORT_4444_TCP_ADDR :$HUB_PORT_4444_TCP_PORT /grid/register \
43- -nodeConfig /home/seluser /selenium/config.json \
43+ -nodeConfig /opt /selenium/config.json \
4444 ${SE_OPTS} &
4545NODE_PID=$!
4646
Original file line number Diff line number Diff line change 11#! /bin/bash
2+ #
3+ # IMPORTANT: Change this file only in directory Standalone!
24
35source /opt/bin/functions.sh
46
@@ -18,7 +20,7 @@ SERVERNUM=$(get_server_num)
1820rm -f /tmp/.X* lock
1921
2022xvfb-run -n $SERVERNUM --server-args=" -screen 0 $GEOMETRY -ac +extension RANDR" \
21- java ${JAVA_OPTS} -jar /home/seluser /selenium/selenium-server-standalone.jar \
23+ java ${JAVA_OPTS} -jar /opt /selenium/selenium-server-standalone.jar \
2224 ${SE_OPTS} &
2325NODE_PID=$!
2426
Original file line number Diff line number Diff line change @@ -21,7 +21,7 @@ SERVERNUM=$(get_server_num)
2121
2222DISPLAY=$DISPLAY \
2323 xvfb-run -n $SERVERNUM --server-args=" -screen 0 $GEOMETRY -ac +extension RANDR" \
24- java ${JAVA_OPTS} -jar /home/seluser /selenium/selenium-server-standalone.jar \
24+ java ${JAVA_OPTS} -jar /opt /selenium/selenium-server-standalone.jar \
2525 ${SE_OPTS} &
2626NODE_PID=$!
2727
You can’t perform that action at this time.
0 commit comments