-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Change Chrome Node to run Selenium Node Directly
Remove init script for running Selenium node in favor of running the jar directly. Part of #3
- Loading branch information
Showing
14 changed files
with
74 additions
and
154 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,8 @@ | ||
FROM elgalu/selenium-base:2.44.0 | ||
FROM selenium/base:2.44.0 | ||
MAINTAINER Selenium <[email protected]> | ||
|
||
#================= | ||
# Locale settings | ||
#================= | ||
ENV LANGUAGE en_US.UTF-8 | ||
ENV LANG en_US.UTF-8 | ||
RUN locale-gen en_US.UTF-8 \ | ||
&& dpkg-reconfigure --frontend noninteractive locales \ | ||
&& apt-get update -qqy \ | ||
&& apt-get -qqy --no-install-recommends install \ | ||
language-pack-en \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
ENV DEBIAN_FRONTEND noninteractive | ||
ENV DEBCONF_NONINTERACTIVE_SEEN true | ||
|
||
#=================== | ||
# Timezone settings | ||
|
@@ -26,47 +17,23 @@ RUN echo "US/Pacific" | sudo tee /etc/timezone \ | |
#============== | ||
RUN apt-get update -qqy \ | ||
&& apt-get -qqy install \ | ||
x11vnc \ | ||
xvfb \ | ||
&& rm -rf /var/lib/apt/lists/* \ | ||
&& mkdir -p /home/seluser/.vnc \ | ||
&& x11vnc -storepasswd secret /home/seluser/.vnc/passwd \ | ||
&& chmod +r /home/seluser/.vnc/passwd | ||
|
||
#======= | ||
# Fonts | ||
#======= | ||
RUN apt-get update -qqy \ | ||
&& apt-get -qqy --no-install-recommends install \ | ||
fonts-ipafont-gothic \ | ||
xfonts-100dpi \ | ||
xfonts-75dpi \ | ||
xfonts-cyrillic \ | ||
xfonts-scalable \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
|
||
#========= | ||
# fluxbox | ||
# A fast, lightweight and responsive window manager | ||
#========= | ||
RUN apt-get update -qqy \ | ||
&& apt-get -qqy --no-install-recommends install \ | ||
fluxbox \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
|
||
#=================================================================================== | ||
# Scripts to run Xvfb, x11vnc, fluxbox, selenium hub, and selenium node as services | ||
#=================================================================================== | ||
COPY ./etc /etc | ||
RUN chmod +x /etc/my_init.d/*.sh \ | ||
&& chmod +x /etc/service/**/run | ||
#============================== | ||
# Scripts to run Selenium Node | ||
#============================== | ||
COPY entry_point.sh /opt/bin/entry_point.sh | ||
RUN chmod +x /opt/bin/entry_point.sh | ||
|
||
#============================ | ||
# Some configuration options | ||
#============================ | ||
ENV SCREEN_WIDTH 1360 | ||
ENV SCREEN_HEIGHT 1020 | ||
ENV SCREEN_DEPTH 24 | ||
ENV DISPLAY :20.0 | ||
ENV DISPLAY :99.0 | ||
|
||
USER seluser | ||
|
||
EXPOSE 5900 | ||
CMD /opt/bin/entry_point.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
#!/bin/bash | ||
export GEOMETRY="$SCREEN_WIDTH""x""$SCREEN_HEIGHT""x""$SCREEN_DEPTH" | ||
|
||
if [ ! -e /opt/selenium/config.json ]; then | ||
echo No Selenium Node configuration file, the node-base image is not intended to be run directly. 1>&2 | ||
exit 1 | ||
fi | ||
|
||
if [ -z "$HUB_PORT_4444_TCP_ADDR" ]; then | ||
echo Not linked with a running Hub container 1>&2 | ||
exit 1 | ||
fi | ||
|
||
# TODO: Look into http://www.seleniumhq.org/docs/05_selenium_rc.jsp#browser-side-logs | ||
|
||
exec xvfb-run --server-args="$DISPLAY -screen 0 $GEOMETRY -ac +extension RANDR" \ | ||
java -jar /opt/selenium/selenium-server-standalone.jar \ | ||
-role node \ | ||
-hub http://hub:4444/grid/register \ | ||
-nodeConfig /opt/selenium/config.json |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
FROM selenium/node-base:2.44.0 | ||
MAINTAINER Selenium <[email protected]> | ||
|
||
USER root | ||
|
||
#=============== | ||
# Google Chrome | ||
#=============== | ||
# TODO: IronPort (My Corporate Firewall) - Remove --no-check-certificate flag | ||
RUN wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub --no-check-certificate | apt-key add - \ | ||
&& echo "deb http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google-chrome.list \ | ||
&& apt-get update -qqy \ | ||
&& apt-get -qqy install \ | ||
google-chrome-stable \ | ||
&& rm /etc/apt/sources.list.d/google-chrome.list \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
|
||
#================== | ||
# Chrome webdriver | ||
#================== | ||
ENV CHROME_DRIVER_VERSION 2.12 | ||
RUN wget --no-verbose -O /tmp/chromedriver_linux64.zip http://chromedriver.storage.googleapis.com/$CHROME_DRIVER_VERSION/chromedriver_linux64.zip \ | ||
&& rm -rf /opt/selenium/chromedriver \ | ||
&& unzip /tmp/chromedriver_linux64.zip -d /opt/selenium \ | ||
&& rm /tmp/chromedriver_linux64.zip \ | ||
&& mv /opt/selenium/chromedriver /opt/selenium/chromedriver-$CHROME_DRIVER_VERSION \ | ||
&& chmod 755 /opt/selenium/chromedriver-$CHROME_DRIVER_VERSION \ | ||
&& ln -fs /opt/selenium/chromedriver-$CHROME_DRIVER_VERSION /usr/bin/chromedriver | ||
|
||
#======================== | ||
# Selenium Configuration | ||
#======================== | ||
COPY config.json /opt/selenium/config.json | ||
|
||
#================================= | ||
# Chrome Launch Script Modication | ||
#================================= | ||
COPY chrome_launcher.sh /opt/google/chrome/google-chrome | ||
RUN chmod +x /opt/google/chrome/google-chrome | ||
|
||
USER seluser |
File renamed without changes.
File renamed without changes.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.