Skip to content

Commit

Permalink
generic namespacing (allow others to easily customize image names)
Browse files Browse the repository at this point in the history
  • Loading branch information
ddavison committed Apr 27, 2017
1 parent c256bbb commit 9e2d610
Show file tree
Hide file tree
Showing 28 changed files with 71 additions and 54 deletions.
2 changes: 1 addition & 1 deletion Base/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
FROM ubuntu:16.04
MAINTAINER Selenium <[email protected]>
LABEL authors="Selenium <[email protected]>"

#================================================
# Customize sources for apt-get
Expand Down
2 changes: 1 addition & 1 deletion Hub/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# PLEASE UPDATE Dockerfile.txt INSTEAD OF THIS FILE
# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
FROM selenium/base:3.4.0-bismuth
MAINTAINER Selenium <[email protected]>
LABEL authors=SeleniumHQ

#========================
# Selenium Configuration
Expand Down
2 changes: 0 additions & 2 deletions Hub/Dockerfile.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
MAINTAINER Selenium <[email protected]>

#========================
# Selenium Configuration
#========================
Expand Down
6 changes: 5 additions & 1 deletion Hub/generate.sh
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
#!/bin/bash
VERSION=$1
NAMESPACE=$2
AUTHORS=$3

echo "# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" > ./Dockerfile
echo "# NOTE: DO *NOT* EDIT THIS FILE. IT IS GENERATED." >> ./Dockerfile
echo "# PLEASE UPDATE Dockerfile.txt INSTEAD OF THIS FILE" >> ./Dockerfile
echo "# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" >> ./Dockerfile
echo FROM selenium/base:$VERSION >> ./Dockerfile
echo FROM $NAMESPACE/base:$VERSION >> ./Dockerfile
echo LABEL authors="$AUTHORS" >> ./Dockerfile
echo "" >> ./Dockerfile
cat ./Dockerfile.txt >> ./Dockerfile
24 changes: 13 additions & 11 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
NAME := selenium
VERSION := $(or $(VERSION),$(VERSION),3.4.0-bismuth)
NAMESPACE := $(or $(NAMESPACE),$(NAMESPACE),$(NAME))
AUTHORS := $(or $(AUTHORS),$(AUTHORS),SeleniumHQ)
PLATFORM := $(shell uname -s)
BUILD_ARGS := $(BUILD_ARGS)
MAJOR := $(word 1,$(subst ., ,$(VERSION)))
Expand Down Expand Up @@ -29,67 +31,67 @@ base:
cd ./Base && docker build $(BUILD_ARGS) -t $(NAME)/base:$(VERSION) .

generate_hub:
cd ./Hub && ./generate.sh $(VERSION)
cd ./Hub && ./generate.sh $(VERSION) $(NAMESPACE) $(AUTHORS)

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

generate_nodebase:
cd ./NodeBase && ./generate.sh $(VERSION)
cd ./NodeBase && ./generate.sh $(VERSION) $(NAMESPACE) $(AUTHORS)

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

generate_chrome:
cd ./NodeChrome && ./generate.sh $(VERSION)
cd ./NodeChrome && ./generate.sh $(VERSION) $(NAMESPACE) $(AUTHORS)

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

generate_firefox:
cd ./NodeFirefox && ./generate.sh $(VERSION)
cd ./NodeFirefox && ./generate.sh $(VERSION) $(NAMESPACE) $(AUTHORS)

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

generate_standalone_firefox:
cd ./Standalone && ./generate.sh StandaloneFirefox node-firefox Firefox $(VERSION)
cd ./Standalone && ./generate.sh StandaloneFirefox node-firefox Firefox $(VERSION) $(NAMESPACE) $(AUTHORS)

standalone_firefox: generate_standalone_firefox firefox
cd ./StandaloneFirefox && docker build $(BUILD_ARGS) -t $(NAME)/standalone-firefox:$(VERSION) .

generate_standalone_firefox_debug:
cd ./StandaloneDebug && ./generate.sh StandaloneFirefoxDebug standalone-firefox Firefox $(VERSION)
cd ./StandaloneDebug && ./generate.sh StandaloneFirefoxDebug standalone-firefox Firefox $(VERSION) $(NAMESPACE) $(AUTHORS)

standalone_firefox_debug: generate_standalone_firefox_debug standalone_firefox
cd ./StandaloneFirefoxDebug && docker build $(BUILD_ARGS) -t $(NAME)/standalone-firefox-debug:$(VERSION) .

generate_standalone_chrome:
cd ./Standalone && ./generate.sh StandaloneChrome node-chrome Chrome $(VERSION)
cd ./Standalone && ./generate.sh StandaloneChrome node-chrome Chrome $(VERSION) $(NAMESPACE) $(AUTHORS)

standalone_chrome: generate_standalone_chrome chrome
cd ./StandaloneChrome && docker build $(BUILD_ARGS) -t $(NAME)/standalone-chrome:$(VERSION) .

generate_standalone_chrome_debug:
cd ./StandaloneDebug && ./generate.sh StandaloneChromeDebug standalone-chrome Chrome $(VERSION)
cd ./StandaloneDebug && ./generate.sh StandaloneChromeDebug standalone-chrome Chrome $(VERSION) $(NAMESPACE) $(AUTHORS)

standalone_chrome_debug: generate_standalone_chrome_debug standalone_chrome
cd ./StandaloneChromeDebug && docker build $(BUILD_ARGS) -t $(NAME)/standalone-chrome-debug:$(VERSION) .

generate_chrome_debug:
cd ./NodeDebug && ./generate.sh NodeChromeDebug node-chrome Chrome $(VERSION)
cd ./NodeDebug && ./generate.sh NodeChromeDebug node-chrome Chrome $(VERSION) $(NAMESPACE) $(AUTHORS)

chrome_debug: generate_chrome_debug chrome
cd ./NodeChromeDebug && docker build $(BUILD_ARGS) -t $(NAME)/node-chrome-debug:$(VERSION) .

generate_firefox_debug:
cd ./NodeDebug && ./generate.sh NodeFirefoxDebug node-firefox Firefox $(VERSION)
cd ./NodeDebug && ./generate.sh NodeFirefoxDebug node-firefox Firefox $(VERSION) $(NAMESPACE) $(AUTHORS)

firefox_debug: generate_firefox_debug firefox
cd ./NodeFirefoxDebug && docker build $(BUILD_ARGS) -t $(NAME)/node-firefox-debug:$(VERSION) .

generate_phantomjs:
cd ./NodePhantomJS && ./generate.sh $(VERSION)
cd ./NodePhantomJS && ./generate.sh $(VERSION) $(NAMESPACE) $(AUTHORS)

phantomjs: nodebase generate_phantomjs
cd ./NodePhantomJS && docker build $(BUILD_ARGS) -t $(NAME)/node-phantomjs:$(VERSION) .
Expand Down
3 changes: 1 addition & 2 deletions NodeBase/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# PLEASE UPDATE Dockerfile.txt INSTEAD OF THIS FILE
# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
FROM selenium/base:3.4.0-bismuth
MAINTAINER Selenium <[email protected]>
LABEL authors=SeleniumHQ

ENV DEBIAN_FRONTEND noninteractive
ENV DEBCONF_NONINTERACTIVE_SEEN true
Expand All @@ -15,7 +15,6 @@ RUN apt-get update -qqy \
&& apt-get -qqy install \
locales \
xvfb \
dbus \
&& rm -rf /var/lib/apt/lists/* /var/cache/apt/*

#==============================
Expand Down
2 changes: 0 additions & 2 deletions NodeBase/Dockerfile.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
MAINTAINER Selenium <[email protected]>

ENV DEBIAN_FRONTEND noninteractive
ENV DEBCONF_NONINTERACTIVE_SEEN true

Expand Down
6 changes: 5 additions & 1 deletion NodeBase/generate.sh
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
#!/bin/bash
VERSION=$1
NAMESPACE=$2
AUTHORS=$3

echo "# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" > ./Dockerfile
echo "# NOTE: DO *NOT* EDIT THIS FILE. IT IS GENERATED." >> ./Dockerfile
echo "# PLEASE UPDATE Dockerfile.txt INSTEAD OF THIS FILE" >> ./Dockerfile
echo "# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" >> ./Dockerfile
echo FROM selenium/base:$VERSION >> ./Dockerfile
echo FROM $NAMESPACE/base:$VERSION >> ./Dockerfile
echo LABEL authors="$AUTHORS" >> ./Dockerfile
echo "" >> ./Dockerfile
cat ./Dockerfile.txt >> ./Dockerfile
11 changes: 5 additions & 6 deletions NodeChrome/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# PLEASE UPDATE Dockerfile.txt INSTEAD OF THIS FILE
# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
FROM selenium/node-base:3.4.0-bismuth
MAINTAINER Selenium <[email protected]>
LABEL authors=SeleniumHQ

USER root

Expand Down Expand Up @@ -62,15 +62,14 @@ COPY generate_config /opt/selenium/generate_config
RUN chmod +x /opt/selenium/generate_config

#=================================
# Chrome Launch Script Modication
# Chrome Launch Script Modification
#=================================
COPY chrome_launcher.sh /opt/google/chrome/google-chrome
RUN chmod +x /opt/google/chrome/google-chrome

RUN chown -R seluser:seluser /opt/selenium

# Following line fixes
# https://github.com/SeleniumHQ/docker-selenium/issues/87
RUN echo "DBUS_SESSION_BUS_ADDRESS=/dev/null" >> /etc/environment
# Following line fixes https://github.com/SeleniumHQ/docker-selenium/issues/87
ENV DBUS_SESSION_BUS_ADDRESS=/dev/null

USER seluser
USER seluser
2 changes: 0 additions & 2 deletions NodeChrome/Dockerfile.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
MAINTAINER Selenium <[email protected]>

USER root

#============================================
Expand Down
6 changes: 5 additions & 1 deletion NodeChrome/generate.sh
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
#!/bin/bash
VERSION=$1
NAMESPACE=$2
AUTHORS=$3

echo "# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" > ./Dockerfile
echo "# NOTE: DO *NOT* EDIT THIS FILE. IT IS GENERATED." >> ./Dockerfile
echo "# PLEASE UPDATE Dockerfile.txt INSTEAD OF THIS FILE" >> ./Dockerfile
echo "# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" >> ./Dockerfile
echo FROM selenium/node-base:$VERSION >> ./Dockerfile
echo FROM $NAMESPACE/node-base:$VERSION >> ./Dockerfile
echo LABEL authors="$AUTHORS" >> ./Dockerfile
echo "" >> ./Dockerfile
cat ./Dockerfile.txt >> ./Dockerfile
2 changes: 1 addition & 1 deletion NodeChromeDebug/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# PLEASE UPDATE Dockerfile.txt INSTEAD OF THIS FILE
# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
FROM selenium/node-chrome:3.4.0-bismuth
MAINTAINER Selenium <[email protected]>
LABEL authors=SeleniumHQ

USER root

Expand Down
2 changes: 0 additions & 2 deletions NodeDebug/Dockerfile.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
MAINTAINER Selenium <[email protected]>

USER root

#=====
Expand Down
6 changes: 5 additions & 1 deletion NodeDebug/generate.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,16 @@ FOLDER=../$1
BASE=$2
BROWSER=$3
VERSION=$4
NAMESPACE=$5
AUTHORS=$6

echo "# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" > $FOLDER/Dockerfile
echo "# NOTE: DO *NOT* EDIT THIS FILE. IT IS GENERATED." >> $FOLDER/Dockerfile
echo "# PLEASE UPDATE Dockerfile.txt INSTEAD OF THIS FILE" >> $FOLDER/Dockerfile
echo "# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" >> $FOLDER/Dockerfile
echo FROM selenium/$BASE:$VERSION >> $FOLDER/Dockerfile
echo FROM $NAMESPACE/$BASE:$VERSION >> $FOLDER/Dockerfile
echo LABEL authors="$AUTHORS" >> $FOLDER/Dockerfile
echo "" >> $FOLDER/Dockerfile
cat ./Dockerfile.txt >> $FOLDER/Dockerfile

cat ./README.template.md \
Expand Down
7 changes: 3 additions & 4 deletions NodeFirefox/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# PLEASE UPDATE Dockerfile.txt INSTEAD OF THIS FILE
# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
FROM selenium/node-base:3.4.0-bismuth
MAINTAINER Selenium <[email protected]>
LABEL authors=SeleniumHQ

USER root

Expand Down Expand Up @@ -58,8 +58,7 @@ COPY generate_config /opt/selenium/generate_config
RUN chmod +x /opt/selenium/generate_config \
&& chown -R seluser:seluser /opt/selenium

# Following line fixes
# https://github.com/SeleniumHQ/docker-selenium/issues/87
RUN echo "DBUS_SESSION_BUS_ADDRESS=/dev/null" >> /etc/environment
# Following line fixes https://github.com/SeleniumHQ/docker-selenium/issues/87
ENV DBUS_SESSION_BUS_ADDRESS=/dev/null

USER seluser
2 changes: 0 additions & 2 deletions NodeFirefox/Dockerfile.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
MAINTAINER Selenium <[email protected]>

USER root

#=========
Expand Down
6 changes: 5 additions & 1 deletion NodeFirefox/generate.sh
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
#!/bin/bash
VERSION=$1
NAMESPACE=$2
AUTHORS=$3

echo "# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" > ./Dockerfile
echo "# NOTE: DO *NOT* EDIT THIS FILE. IT IS GENERATED." >> ./Dockerfile
echo "# PLEASE UPDATE Dockerfile.txt INSTEAD OF THIS FILE" >> ./Dockerfile
echo "# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" >> ./Dockerfile
echo FROM selenium/node-base:$VERSION >> ./Dockerfile
echo FROM $NAMESPACE/node-base:$VERSION >> ./Dockerfile
echo LABEL authors="$AUTHORS" >> ./Dockerfile
echo "" >> ./Dockerfile
cat ./Dockerfile.txt >> ./Dockerfile
2 changes: 1 addition & 1 deletion NodeFirefoxDebug/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# PLEASE UPDATE Dockerfile.txt INSTEAD OF THIS FILE
# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
FROM selenium/node-firefox:3.4.0-bismuth
MAINTAINER Selenium <[email protected]>
LABEL authors=SeleniumHQ

USER root

Expand Down
2 changes: 1 addition & 1 deletion NodePhantomJS/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# PLEASE UPDATE Dockerfile.txt INSTEAD OF THIS FILE
# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
FROM selenium/node-base:3.4.0-bismuth
MAINTAINER Selenium <[email protected]>
LABEL authors=SeleniumHQ

USER root

Expand Down
2 changes: 0 additions & 2 deletions NodePhantomJS/Dockerfile.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
MAINTAINER Selenium <[email protected]>

USER root

#==============
Expand Down
6 changes: 5 additions & 1 deletion NodePhantomJS/generate.sh
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
#!/bin/bash
VERSION=$1
NAMESPACE=$2
AUTHORS=$3

echo "# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" > ./Dockerfile
echo "# NOTE: DO *NOT* EDIT THIS FILE. IT IS GENERATED." >> ./Dockerfile
echo "# PLEASE UPDATE Dockerfile.txt INSTEAD OF THIS FILE" >> ./Dockerfile
echo "# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" >> ./Dockerfile
echo FROM selenium/node-base:$VERSION >> ./Dockerfile
echo FROM $NAMESPACE/node-base:$VERSION >> ./Dockerfile
echo LABEL authors="$AUTHORS" >> ./Dockerfile
echo "" >> ./Dockerfile
cat ./Dockerfile.txt >> ./Dockerfile
2 changes: 0 additions & 2 deletions Standalone/Dockerfile.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
MAINTAINER Selenium <[email protected]>

USER root

#====================================
Expand Down
6 changes: 5 additions & 1 deletion Standalone/generate.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,16 @@ FOLDER=../$1
BASE=$2
BROWSER=$3
VERSION=$4
NAMESPACE=$5
AUTHORS=$6

echo "# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" > $FOLDER/Dockerfile
echo "# NOTE: DO *NOT* EDIT THIS FILE. IT IS GENERATED." >> $FOLDER/Dockerfile
echo "# PLEASE UPDATE Dockerfile.txt INSTEAD OF THIS FILE" >> $FOLDER/Dockerfile
echo "# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" >> $FOLDER/Dockerfile
echo FROM selenium/$BASE:$VERSION >> $FOLDER/Dockerfile
echo FROM $NAMESPACE/$BASE:$VERSION >> $FOLDER/Dockerfile
echo LABEL authors="$AUTHORS" >> $FOLDER/Dockerfile
echo "" >> $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
Expand Up @@ -3,7 +3,7 @@
# PLEASE UPDATE Dockerfile.txt INSTEAD OF THIS FILE
# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
FROM selenium/node-chrome:3.4.0-bismuth
MAINTAINER Selenium <[email protected]>
LABEL authors=SeleniumHQ

USER root

Expand Down
2 changes: 1 addition & 1 deletion StandaloneChromeDebug/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# PLEASE UPDATE Dockerfile.txt INSTEAD OF THIS FILE
# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
FROM selenium/standalone-chrome:3.4.0-bismuth
MAINTAINER Selenium <[email protected]>
LABEL authors=SeleniumHQ

USER root

Expand Down
6 changes: 5 additions & 1 deletion StandaloneDebug/generate.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,16 @@ FOLDER=../$1
BASE=$2
BROWSER=$3
VERSION=$4
NAMESPACE=$5
AUTHORS=$6

echo "# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" > $FOLDER/Dockerfile
echo "# NOTE: DO *NOT* EDIT THIS FILE. IT IS GENERATED." >> $FOLDER/Dockerfile
echo "# PLEASE UPDATE Dockerfile.txt INSTEAD OF THIS FILE" >> $FOLDER/Dockerfile
echo "# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" >> $FOLDER/Dockerfile
echo FROM selenium/$BASE:$VERSION >> $FOLDER/Dockerfile
echo FROM $NAMESPACE/$BASE:$VERSION >> $FOLDER/Dockerfile
echo LABEL authors="$AUTHORS" >> $FOLDER/Dockerfile
echo "" >> $FOLDER/Dockerfile
cat ../NodeDebug/Dockerfile.txt >> $FOLDER/Dockerfile

cp ./entry_point.sh $FOLDER
Expand Down
2 changes: 1 addition & 1 deletion StandaloneFirefox/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# PLEASE UPDATE Dockerfile.txt INSTEAD OF THIS FILE
# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
FROM selenium/node-firefox:3.4.0-bismuth
MAINTAINER Selenium <[email protected]>
LABEL authors=SeleniumHQ

USER root

Expand Down
Loading

0 comments on commit 9e2d610

Please sign in to comment.