Skip to content

FROM field in each Dockerfile version specific #68

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
2 commits merged into from
Jun 11, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 <[email protected]>

#========================
# 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
37 changes: 33 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,23 +4,47 @@ PLATFORM := $(shell uname -s)

all: hub chrome firefox chromedebug firefoxdebug standalone_chrome standalone_firefox standalone_debug_chrome standalone_debug_firefox

generate_all: \
generate_hub \
generate_nodebase \
generate_chrome \
generate_firefox \
generate_chromedebug \
generate_firefoxdebug \
generate_standalone_firefox \
generate_standalone_chrome \
generate_standalone_debug_firefox \
generate_standalone_debug_chrome

build: all

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 Expand Up @@ -106,6 +130,11 @@ test:
ci \
firefox \
firefoxdebug \
generate_all \
generate_hub \
generate_nodebase \
generate_chrome \
generate_firefox \
generate_chromedebug \
generate_firefoxdebug \
generate_standalone_chrome \
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 <[email protected]>

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 <[email protected]>

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
1 change: 0 additions & 1 deletion NodeChromeDebug/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
FROM selenium/node-chrome:2.46.0
#FROM selenium/node-*:2.46.0 Proper FROM attr will be applied throuh generate.sh
MAINTAINER Selenium <[email protected]>

USER root
Expand Down
1 change: 0 additions & 1 deletion NodeDebug/Dockerfile → NodeDebug/Dockerfile.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#FROM selenium/node-*:2.46.0 Proper FROM attr will be applied throuh generate.sh
MAINTAINER Selenium <[email protected]>

USER root
Expand Down
2 changes: 1 addition & 1 deletion NodeDebug/README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# Debug image template

This folder is not meant to be build directly from the `docker build .` It only stands as a template for creating debug images derived from Selenium Node Browser images. Note usage in the Makefile at the root of this repo.
This folder serves as a template for creating debug images derived from Selenium Node Browser images. Note usage in the Makefile at the root of this repo.
2 changes: 1 addition & 1 deletion NodeDebug/generate.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ rm -rf $FOLDER
mkdir -p $FOLDER

echo FROM selenium/$BASE:$VERSION > $FOLDER/Dockerfile
cat ./Dockerfile >> $FOLDER/Dockerfile
cat ./Dockerfile.txt >> $FOLDER/Dockerfile

cat ../NodeBase/entry_point.sh \
| sed 's/^xvfb-run/sudo -E -i -u seluser \\\
Expand Down
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 <[email protected]>

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
1 change: 0 additions & 1 deletion NodeFirefoxDebug/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
FROM selenium/node-firefox:2.46.0
#FROM selenium/node-*:2.46.0 Proper FROM attr will be applied throuh generate.sh
MAINTAINER Selenium <[email protected]>

USER root
Expand Down
2 changes: 1 addition & 1 deletion Standalone/Dockerfile → Standalone/Dockerfile.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#FROM selenium/node-*:2.46.0 Proper FROM attr will be applied throuh generate.sh
MAINTAINER Selenium <selenium[email protected]>

USER root

Expand Down
2 changes: 1 addition & 1 deletion Standalone/README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# Debug image template

This folder is not meant to be build directly from the `docker build .` It only stands as a template for creating standalone server images derived from Selenium Node Browser images. Note usage in the Makefile at the root of this repo.
This folder servers as a template for creating standalone server images derived from Selenium Node Browser images. Note usage in the Makefile at the root of this repo.
2 changes: 1 addition & 1 deletion Standalone/generate.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ rm -rf $FOLDER
mkdir -p $FOLDER

echo FROM selenium/$BASE:$VERSION > $FOLDER/Dockerfile
cat ./Dockerfile >> $FOLDER/Dockerfile
cat ./Dockerfile.txt >> $FOLDER/Dockerfile

cp ./entry_point.sh $FOLDER

Expand Down
2 changes: 1 addition & 1 deletion StandaloneChrome/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
FROM selenium/node-chrome:2.46.0
#FROM selenium/node-*:2.46.0 Proper FROM attr will be applied throuh generate.sh
MAINTAINER Selenium <selenium[email protected]>

USER root

Expand Down
2 changes: 1 addition & 1 deletion StandaloneDebug/README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# Debug image template

This folder is not meant to be build directly from the `docker build .` It only stands as a template for creating standalone server debug images. Note usage in the Makefile at the root of this repo.
This folder serves as a template for creating standalone server debug images. Note usage in the Makefile at the root of this repo.
2 changes: 1 addition & 1 deletion StandaloneDebug/generate.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ rm -rf $FOLDER
mkdir -p $FOLDER

echo FROM selenium/$BASE:$VERSION > $FOLDER/Dockerfile
cat ../NodeDebug/Dockerfile >> $FOLDER/Dockerfile
cat ../NodeDebug/Dockerfile.txt >> $FOLDER/Dockerfile

cp ./entry_point.sh $FOLDER

Expand Down
1 change: 0 additions & 1 deletion StandaloneDebugChrome/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
FROM selenium/standalone-chrome:2.46.0
#FROM selenium/node-*:2.46.0 Proper FROM attr will be applied throuh generate.sh
MAINTAINER Selenium <[email protected]>

USER root
Expand Down
1 change: 0 additions & 1 deletion StandaloneDebugFirefox/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
FROM selenium/standalone-firefox:2.46.0
#FROM selenium/node-*:2.46.0 Proper FROM attr will be applied throuh generate.sh
MAINTAINER Selenium <[email protected]>

USER root
Expand Down
2 changes: 1 addition & 1 deletion StandaloneFirefox/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
FROM selenium/node-firefox:2.46.0
#FROM selenium/node-*:2.46.0 Proper FROM attr will be applied throuh generate.sh
MAINTAINER Selenium <selenium[email protected]>

USER root

Expand Down