Skip to content

Commit

Permalink
remove xvfb stuff from nodedebug generation script; add tzdata, locales
Browse files Browse the repository at this point in the history
  • Loading branch information
ddavison committed Apr 13, 2017
1 parent 2b6bf9c commit 3bef451
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 35 deletions.
17 changes: 9 additions & 8 deletions Base/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,6 @@ RUN echo "deb http://archive.ubuntu.com/ubuntu xenial main universe\n" > /etc/a
&& echo "deb http://archive.ubuntu.com/ubuntu xenial-updates main universe\n" >> /etc/apt/sources.list \
&& echo "deb http://security.ubuntu.com/ubuntu xenial-security main universe\n" >> /etc/apt/sources.list

#===================
# Timezone settings
# Possible alternative: https://github.com/docker/docker/issues/3359#issuecomment-32150214
#===================
ENV TZ "UTC"
RUN echo "${TZ}" > /etc/timezone \
&& dpkg-reconfigure --frontend noninteractive tzdata

#========================
# Miscellaneous packages
# Includes minimal runtime used for executing non GUI Java programs
Expand All @@ -25,12 +17,21 @@ RUN apt-get update -qqy \
bzip2 \
ca-certificates \
openjdk-8-jre-headless \
tzdata \
sudo \
unzip \
wget \
&& rm -rf /var/lib/apt/lists/* /var/cache/apt/* \
&& sed -i 's/securerandom\.source=file:\/dev\/random/securerandom\.source=file:\/dev\/urandom/' ./usr/lib/jvm/java-8-openjdk-amd64/jre/lib/security/java.security

#===================
# Timezone settings
# Possible alternative: https://github.com/docker/docker/issues/3359#issuecomment-32150214
#===================
ENV TZ "UTC"
RUN echo "${TZ}" > /etc/timezone \
&& dpkg-reconfigure --frontend noninteractive tzdata

#==========
# Selenium
#==========
Expand Down
1 change: 1 addition & 0 deletions NodeBase/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ ENV DEBCONF_NONINTERACTIVE_SEEN true
#==============
RUN apt-get update -qqy \
&& apt-get -qqy install \
locales \
xvfb \
&& rm -rf /var/lib/apt/lists/* /var/cache/apt/*

Expand Down
1 change: 1 addition & 0 deletions NodeBase/Dockerfile.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ ENV DEBCONF_NONINTERACTIVE_SEEN true
#==============
RUN apt-get update -qqy \
&& apt-get -qqy install \
locales \
xvfb \
&& rm -rf /var/lib/apt/lists/* /var/cache/apt/*

Expand Down
6 changes: 3 additions & 3 deletions NodeChromeDebug/entry_point.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@ SERVERNUM=$(get_server_num)
rm -f /tmp/.X*lock

env | cut -f 1 -d "=" | sort > asroot
sudo -E -u seluser -i env | cut -f 1 -d "=" | sort > asseluser
sudo -E -i -u seluser \
"$(for E in $(grep -vxFf asseluser asroot); do echo $E=$(eval echo \$$E); done)" \
sudo -E -u seluser -i env | cut -f 1 -d "=" | sort > asseluser
sudo -E -i -u seluser \
$(for E in $(grep -vxFf asseluser asroot); do echo $E=$(eval echo \$$E); done) \
DISPLAY=$DISPLAY \
xvfb-run -n $SERVERNUM --server-args="-screen 0 $GEOMETRY -ac +extension RANDR" \
java ${JAVA_OPTS} -jar /opt/selenium/selenium-server-standalone.jar \
Expand Down
24 changes: 0 additions & 24 deletions NodeDebug/generate.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,30 +11,6 @@ echo "# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" >> $FOLDER/Dockerfil
echo FROM selenium/$BASE:$VERSION >> $FOLDER/Dockerfile
cat ./Dockerfile.txt >> $FOLDER/Dockerfile

cat ../NodeBase/entry_point.sh \
| sed 's/^xvfb-run/env | cut -f 1 -d "=" | sort > asroot\
sudo -E -u seluser -i env | cut -f 1 -d "=" | sort > asseluser\
sudo -E -i -u seluser \\\
$(for E in $(grep -vxFf asseluser asroot); do echo $E=$(eval echo \\\$$E); done) \\\
DISPLAY=$DISPLAY \\\
xvfb-run/' \
| sed 's/^wait \$NODE_PID/for i in $(seq 1 10)\
do\
xdpyinfo -display $DISPLAY >\/dev\/null 2>\&1\
if [ $? -eq 0 ]; then\
break\
fi\
echo Waiting xvfb...\
sleep 0.5\
done\
\
fluxbox -display $DISPLAY \&\
\
x11vnc -forever -usepw -shared -rfbport 5900 -display $DISPLAY \&\
\
wait \$NODE_PID/' \
> $FOLDER/entry_point.sh

cat ./README.template.md \
| sed "s/##BROWSER##/$BROWSER/" \
| sed "s/##BASE##/$BASE/" \
Expand Down

0 comments on commit 3bef451

Please sign in to comment.