Skip to content

Commit 218568c

Browse files
author
rubytester
committed
Merge pull request #68 from SeleniumHQ/fix_issue_1
FROM field in each Dockerfile version specific
2 parents 78d60bd + 5135b9b commit 218568c

File tree

23 files changed

+182
-18
lines changed

23 files changed

+182
-18
lines changed

Hub/Dockerfile.txt

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
MAINTAINER Selenium <[email protected]>
2+
3+
#========================
4+
# Selenium Configuration
5+
#========================
6+
7+
EXPOSE 4444
8+
9+
ENV GRID_NEW_SESSION_WAIT_TIMEOUT -1
10+
ENV GRID_JETTY_MAX_THREADS -1
11+
ENV GRID_NODE_POLLING 5000
12+
ENV GRID_CLEAN_UP_CYCLE 5000
13+
ENV GRID_TIMEOUT 30000
14+
ENV GRID_BROWSER_TIMEOUT 0
15+
ENV GRID_MAX_SESSION 5
16+
ENV GRID_UNREGISTER_IF_STILL_DOWN_AFTER 30000
17+
18+
COPY generate_config /opt/selenium/generate_config
19+
COPY entry_point.sh /opt/bin/entry_point.sh
20+
RUN chown -R seluser /opt/selenium
21+
22+
USER seluser
23+
24+
CMD ["/opt/bin/entry_point.sh"]
25+

Hub/generate.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#!/bin/bash
2+
VERSION=$1
3+
4+
echo FROM selenium/base:$VERSION > ./Dockerfile
5+
cat ./Dockerfile.txt >> ./Dockerfile

Makefile

Lines changed: 33 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,23 +4,47 @@ PLATFORM := $(shell uname -s)
44

55
all: hub chrome firefox chromedebug firefoxdebug standalone_chrome standalone_firefox standalone_debug_chrome standalone_debug_firefox
66

7+
generate_all: \
8+
generate_hub \
9+
generate_nodebase \
10+
generate_chrome \
11+
generate_firefox \
12+
generate_chromedebug \
13+
generate_firefoxdebug \
14+
generate_standalone_firefox \
15+
generate_standalone_chrome \
16+
generate_standalone_debug_firefox \
17+
generate_standalone_debug_chrome
18+
719
build: all
820

921
ci: build test
1022

1123
base:
1224
cd ./Base && docker build -t $(NAME)/base:$(VERSION) .
1325

14-
hub: base
26+
generate_hub:
27+
cd ./Hub && ./generate.sh $(VERSION)
28+
29+
hub: base generate_hub
1530
cd ./Hub && docker build -t $(NAME)/hub:$(VERSION) .
1631

17-
nodebase: base
32+
generate_nodebase:
33+
cd ./NodeBase && ./generate.sh $(VERSION)
34+
35+
nodebase: base generate_nodebase
1836
cd ./NodeBase && docker build -t $(NAME)/node-base:$(VERSION) .
1937

20-
chrome: nodebase
38+
generate_chrome:
39+
cd ./NodeChrome && ./generate.sh $(VERSION)
40+
41+
chrome: nodebase generate_chrome
2142
cd ./NodeChrome && docker build -t $(NAME)/node-chrome:$(VERSION) .
2243

23-
firefox: nodebase
44+
generate_firefox:
45+
cd ./NodeFirefox && ./generate.sh $(VERSION)
46+
47+
firefox: nodebase generate_firefox
2448
cd ./NodeFirefox && docker build -t $(NAME)/node-firefox:$(VERSION) .
2549

2650
generate_standalone_firefox:
@@ -106,6 +130,11 @@ test:
106130
ci \
107131
firefox \
108132
firefoxdebug \
133+
generate_all \
134+
generate_hub \
135+
generate_nodebase \
136+
generate_chrome \
137+
generate_firefox \
109138
generate_chromedebug \
110139
generate_firefoxdebug \
111140
generate_standalone_chrome \

NodeBase/Dockerfile.txt

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
MAINTAINER Selenium <[email protected]>
2+
3+
ENV DEBIAN_FRONTEND noninteractive
4+
ENV DEBCONF_NONINTERACTIVE_SEEN true
5+
6+
#===================
7+
# Timezone settings
8+
# Possible alternative: https://github.com/docker/docker/issues/3359#issuecomment-32150214
9+
#===================
10+
ENV TZ "US/Pacific"
11+
RUN echo "US/Pacific" | sudo tee /etc/timezone \
12+
&& dpkg-reconfigure --frontend noninteractive tzdata
13+
14+
#==============
15+
# VNC and Xvfb
16+
#==============
17+
RUN apt-get update -qqy \
18+
&& apt-get -qqy install \
19+
xvfb \
20+
&& rm -rf /var/lib/apt/lists/*
21+
22+
#==============================
23+
# Scripts to run Selenium Node
24+
#==============================
25+
COPY entry_point.sh /opt/bin/entry_point.sh
26+
RUN chmod +x /opt/bin/entry_point.sh
27+
28+
#============================
29+
# Some configuration options
30+
#============================
31+
ENV SCREEN_WIDTH 1360
32+
ENV SCREEN_HEIGHT 1020
33+
ENV SCREEN_DEPTH 24
34+
ENV DISPLAY :99.0
35+
36+
USER seluser
37+
38+
CMD ["/opt/bin/entry_point.sh"]

NodeBase/generate.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#!/bin/bash
2+
VERSION=$1
3+
4+
echo FROM selenium/base:$VERSION > ./Dockerfile
5+
cat ./Dockerfile.txt >> ./Dockerfile

NodeChrome/Dockerfile.txt

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
MAINTAINER Selenium <[email protected]>
2+
3+
USER root
4+
5+
#===============
6+
# Google Chrome
7+
#===============
8+
RUN wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add - \
9+
&& echo "deb http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google-chrome.list \
10+
&& apt-get update -qqy \
11+
&& apt-get -qqy install \
12+
google-chrome-stable \
13+
&& rm /etc/apt/sources.list.d/google-chrome.list \
14+
&& rm -rf /var/lib/apt/lists/*
15+
16+
#==================
17+
# Chrome webdriver
18+
#==================
19+
ENV CHROME_DRIVER_VERSION 2.15
20+
RUN wget --no-verbose -O /tmp/chromedriver_linux64.zip http://chromedriver.storage.googleapis.com/$CHROME_DRIVER_VERSION/chromedriver_linux64.zip \
21+
&& rm -rf /opt/selenium/chromedriver \
22+
&& unzip /tmp/chromedriver_linux64.zip -d /opt/selenium \
23+
&& rm /tmp/chromedriver_linux64.zip \
24+
&& mv /opt/selenium/chromedriver /opt/selenium/chromedriver-$CHROME_DRIVER_VERSION \
25+
&& chmod 755 /opt/selenium/chromedriver-$CHROME_DRIVER_VERSION \
26+
&& ln -fs /opt/selenium/chromedriver-$CHROME_DRIVER_VERSION /usr/bin/chromedriver
27+
28+
#========================
29+
# Selenium Configuration
30+
#========================
31+
COPY config.json /opt/selenium/config.json
32+
33+
#=================================
34+
# Chrome Launch Script Modication
35+
#=================================
36+
COPY chrome_launcher.sh /opt/google/chrome/google-chrome
37+
RUN chmod +x /opt/google/chrome/google-chrome
38+
39+
USER seluser

NodeChrome/generate.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#!/bin/bash
2+
VERSION=$1
3+
4+
echo FROM selenium/node-base:$VERSION > ./Dockerfile
5+
cat ./Dockerfile.txt >> ./Dockerfile

NodeChromeDebug/Dockerfile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
FROM selenium/node-chrome:2.46.0
2-
#FROM selenium/node-*:2.46.0 Proper FROM attr will be applied throuh generate.sh
32
MAINTAINER Selenium <[email protected]>
43

54
USER root

NodeDebug/Dockerfile renamed to NodeDebug/Dockerfile.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
#FROM selenium/node-*:2.46.0 Proper FROM attr will be applied throuh generate.sh
21
MAINTAINER Selenium <[email protected]>
32

43
USER root

NodeDebug/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
# Debug image template
22

3-
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.
3+
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.

NodeDebug/generate.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ rm -rf $FOLDER
88
mkdir -p $FOLDER
99

1010
echo FROM selenium/$BASE:$VERSION > $FOLDER/Dockerfile
11-
cat ./Dockerfile >> $FOLDER/Dockerfile
11+
cat ./Dockerfile.txt >> $FOLDER/Dockerfile
1212

1313
cat ../NodeBase/entry_point.sh \
1414
| sed 's/^xvfb-run/sudo -E -i -u seluser \\\

NodeFirefox/Dockerfile.txt

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
MAINTAINER Selenium <[email protected]>
2+
3+
USER root
4+
5+
#=========
6+
# Firefox
7+
#=========
8+
RUN apt-get update -qqy \
9+
&& apt-get -qqy --no-install-recommends install \
10+
firefox \
11+
&& rm -rf /var/lib/apt/lists/*
12+
13+
#========================
14+
# Selenium Configuration
15+
#========================
16+
COPY config.json /opt/selenium/config.json
17+
18+
USER seluser

NodeFirefox/generate.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#!/bin/bash
2+
VERSION=$1
3+
4+
echo FROM selenium/node-base:$VERSION > ./Dockerfile
5+
cat ./Dockerfile.txt >> ./Dockerfile

NodeFirefoxDebug/Dockerfile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
FROM selenium/node-firefox:2.46.0
2-
#FROM selenium/node-*:2.46.0 Proper FROM attr will be applied throuh generate.sh
32
MAINTAINER Selenium <[email protected]>
43

54
USER root

Standalone/Dockerfile renamed to Standalone/Dockerfile.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#FROM selenium/node-*:2.46.0 Proper FROM attr will be applied throuh generate.sh
1+
MAINTAINER Selenium <selenium[email protected]>
22

33
USER root
44

Standalone/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
# Debug image template
22

3-
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.
3+
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.

Standalone/generate.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ rm -rf $FOLDER
88
mkdir -p $FOLDER
99

1010
echo FROM selenium/$BASE:$VERSION > $FOLDER/Dockerfile
11-
cat ./Dockerfile >> $FOLDER/Dockerfile
11+
cat ./Dockerfile.txt >> $FOLDER/Dockerfile
1212

1313
cp ./entry_point.sh $FOLDER
1414

StandaloneChrome/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
FROM selenium/node-chrome:2.46.0
2-
#FROM selenium/node-*:2.46.0 Proper FROM attr will be applied throuh generate.sh
2+
MAINTAINER Selenium <selenium[email protected]>
33

44
USER root
55

StandaloneDebug/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
# Debug image template
22

3-
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.
3+
This folder serves as a template for creating standalone server debug images. Note usage in the Makefile at the root of this repo.

StandaloneDebug/generate.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ rm -rf $FOLDER
88
mkdir -p $FOLDER
99

1010
echo FROM selenium/$BASE:$VERSION > $FOLDER/Dockerfile
11-
cat ../NodeDebug/Dockerfile >> $FOLDER/Dockerfile
11+
cat ../NodeDebug/Dockerfile.txt >> $FOLDER/Dockerfile
1212

1313
cp ./entry_point.sh $FOLDER
1414

StandaloneDebugChrome/Dockerfile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
FROM selenium/standalone-chrome:2.46.0
2-
#FROM selenium/node-*:2.46.0 Proper FROM attr will be applied throuh generate.sh
32
MAINTAINER Selenium <[email protected]>
43

54
USER root

StandaloneDebugFirefox/Dockerfile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
FROM selenium/standalone-firefox:2.46.0
2-
#FROM selenium/node-*:2.46.0 Proper FROM attr will be applied throuh generate.sh
32
MAINTAINER Selenium <[email protected]>
43

54
USER root

StandaloneFirefox/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
FROM selenium/node-firefox:2.46.0
2-
#FROM selenium/node-*:2.46.0 Proper FROM attr will be applied throuh generate.sh
2+
MAINTAINER Selenium <selenium[email protected]>
33

44
USER root
55

0 commit comments

Comments
 (0)