Skip to content

Commit

Permalink
FROM field in each Dockerfile is version specific
Browse files Browse the repository at this point in the history
fix issue #1

example:
VERSION=local make ball

should build all Dockerfile FROM field with 'local' tag
  • Loading branch information
rubytester committed Jun 9, 2015
1 parent 78d60bd commit 2412f6b
Show file tree
Hide file tree
Showing 9 changed files with 156 additions and 4 deletions.
25 changes: 25 additions & 0 deletions Hub/Dockerfile.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
MAINTAINER Selenium <selenium-developers@googlegroups.com>

#========================
# Selenium Configuration
#========================

EXPOSE 4444

ENV GRID_NEW_SESSION_WAIT_TIMEOUT -1
ENV GRID_JETTY_MAX_THREADS -1
ENV GRID_NODE_POLLING 5000
ENV GRID_CLEAN_UP_CYCLE 5000
ENV GRID_TIMEOUT 30000
ENV GRID_BROWSER_TIMEOUT 0
ENV GRID_MAX_SESSION 5
ENV GRID_UNREGISTER_IF_STILL_DOWN_AFTER 30000

COPY generate_config /opt/selenium/generate_config
COPY entry_point.sh /opt/bin/entry_point.sh
RUN chown -R seluser /opt/selenium

USER seluser

CMD ["/opt/bin/entry_point.sh"]

5 changes: 5 additions & 0 deletions Hub/generate.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/bash
VERSION=$1

echo FROM selenium/base:$VERSION > ./Dockerfile
cat ./Dockerfile.txt >> ./Dockerfile
20 changes: 16 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,28 @@ ci: build test
base:
cd ./Base && docker build -t $(NAME)/base:$(VERSION) .

hub: base
generate_hub:
cd ./Hub && ./generate.sh $(VERSION)

hub: base generate_hub
cd ./Hub && docker build -t $(NAME)/hub:$(VERSION) .

nodebase: base
generate_nodebase:
cd ./NodeBase && ./generate.sh $(VERSION)

nodebase: base generate_nodebase
cd ./NodeBase && docker build -t $(NAME)/node-base:$(VERSION) .

chrome: nodebase
generate_chrome:
cd ./NodeChrome && ./generate.sh $(VERSION)

chrome: nodebase generate_chrome
cd ./NodeChrome && docker build -t $(NAME)/node-chrome:$(VERSION) .

firefox: nodebase
generate_firefox:
cd ./NodeFirefox && ./generate.sh $(VERSION)

firefox: nodebase generate_firefox
cd ./NodeFirefox && docker build -t $(NAME)/node-firefox:$(VERSION) .

generate_standalone_firefox:
Expand Down
38 changes: 38 additions & 0 deletions NodeBase/Dockerfile.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
MAINTAINER Selenium <selenium-developers@googlegroups.com>

ENV DEBIAN_FRONTEND noninteractive
ENV DEBCONF_NONINTERACTIVE_SEEN true

#===================
# Timezone settings
# Possible alternative: https://github.com/docker/docker/issues/3359#issuecomment-32150214
#===================
ENV TZ "US/Pacific"
RUN echo "US/Pacific" | sudo tee /etc/timezone \
&& dpkg-reconfigure --frontend noninteractive tzdata

#==============
# VNC and Xvfb
#==============
RUN apt-get update -qqy \
&& apt-get -qqy install \
xvfb \
&& rm -rf /var/lib/apt/lists/*

#==============================
# 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 :99.0

USER seluser

CMD ["/opt/bin/entry_point.sh"]
5 changes: 5 additions & 0 deletions NodeBase/generate.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/bash
VERSION=$1

echo FROM selenium/base:$VERSION > ./Dockerfile
cat ./Dockerfile.txt >> ./Dockerfile
39 changes: 39 additions & 0 deletions NodeChrome/Dockerfile.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
MAINTAINER Selenium <selenium-developers@googlegroups.com>

USER root

#===============
# Google Chrome
#===============
RUN wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | 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.15
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
5 changes: 5 additions & 0 deletions NodeChrome/generate.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/bash
VERSION=$1

echo FROM selenium/node-base:$VERSION > ./Dockerfile
cat ./Dockerfile.txt >> ./Dockerfile
18 changes: 18 additions & 0 deletions NodeFirefox/Dockerfile.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
MAINTAINER Selenium <selenium-developers@googlegroups.com>

USER root

#=========
# Firefox
#=========
RUN apt-get update -qqy \
&& apt-get -qqy --no-install-recommends install \
firefox \
&& rm -rf /var/lib/apt/lists/*

#========================
# Selenium Configuration
#========================
COPY config.json /opt/selenium/config.json

USER seluser
5 changes: 5 additions & 0 deletions NodeFirefox/generate.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/bash
VERSION=$1

echo FROM selenium/node-base:$VERSION > ./Dockerfile
cat ./Dockerfile.txt >> ./Dockerfile

0 comments on commit 2412f6b

Please sign in to comment.