Skip to content

Commit d30eac8

Browse files
committed
Creating grid-base, to enable creating browser only containers
1 parent 84d8ea1 commit d30eac8

File tree

14 files changed

+190
-15
lines changed

14 files changed

+190
-15
lines changed

Base/Dockerfile

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM ubuntu:bionic-20191029
1+
FROM ubuntu:bionic-20200311
22
LABEL authors="Selenium <[email protected]>"
33

44
#================================================
@@ -18,19 +18,27 @@ ENV DEBIAN_FRONTEND=noninteractive \
1818
#========================
1919
RUN apt-get -qqy update \
2020
&& apt-get -qqy --no-install-recommends install \
21+
# bzip2 - high-quality block-sorting file compressor - utilities https://packages.ubuntu.com/bionic/bzip2
2122
bzip2 \
23+
# Common CA certificates - https://packages.ubuntu.com/bionic/ca-certificates
2224
ca-certificates \
23-
openjdk-8-jre-headless \
25+
# OpenJDK Java runtime, using Hotspot JIT (headless) - https://packages.ubuntu.com/bionic/openjdk-8-jre-headless
2426
tzdata \
27+
# Provide limited super user privileges to specific users - https://packages.ubuntu.com/bionic/sudo
2528
sudo \
29+
# De-archiver for .zip files - https://packages.ubuntu.com/bionic/unzip
2630
unzip \
31+
# retrieves files from the web - https://packages.ubuntu.com/bionic/wget
2732
wget \
33+
# lightweight and flexible command-line JSON processor - https://packages.ubuntu.com/bionic/jq
2834
jq \
35+
# command line tool for transferring data with URL syntax - https://packages.ubuntu.com/bionic/curl
2936
curl \
37+
# System for controlling process state - https://packages.ubuntu.com/bionic/supervisor
3038
supervisor \
39+
# GNU privacy guard - a free PGP replacement (dummy transitional package) - https://packages.ubuntu.com/bionic/gnupg2
3140
gnupg2 \
32-
&& rm -rf /var/lib/apt/lists/* /var/cache/apt/* \
33-
&& sed -i 's/securerandom\.source=file:\/dev\/random/securerandom\.source=file:\/dev\/urandom/' ./usr/lib/jvm/java-8-openjdk-amd64/jre/lib/security/java.security
41+
&& rm -rf /var/lib/apt/lists/* /var/cache/apt/*
3442

3543
#===================
3644
# Timezone settings
@@ -51,11 +59,6 @@ RUN useradd seluser \
5159
&& echo 'seluser:secret' | chpasswd
5260
ENV HOME=/home/seluser
5361

54-
#======================================
55-
# Add Grid check script
56-
#======================================
57-
COPY check-grid.sh entry_point.sh /opt/bin/
58-
5962
#======================================
6063
# Add Supervisor configuration file
6164
#======================================

GridBase/Dockerfile

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
2+
# NOTE: DO *NOT* EDIT THIS FILE. IT IS GENERATED.
3+
# PLEASE UPDATE Dockerfile.txt INSTEAD OF THIS FILE
4+
# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
5+
FROM selenium/base:4.0.0-alpha-5-20200326
6+
LABEL authors=SeleniumHQ
7+
8+
USER root
9+
10+
#========================
11+
# Miscellaneous packages
12+
# Includes minimal runtime used for executing non GUI Java programs
13+
#========================
14+
RUN apt-get update -qqy \
15+
&& apt-get -qqy --no-install-recommends install \
16+
# OpenJDK Java runtime, using Hotspot JIT (headless) - https://packages.ubuntu.com/bionic/openjdk-8-jre-headless
17+
openjdk-8-jre-headless \
18+
&& rm -rf /var/lib/apt/lists/* /var/cache/apt/* \
19+
&& sed -i 's/securerandom\.source=file:\/dev\/random/securerandom\.source=file:\/dev\/urandom/' ./usr/lib/jvm/java-8-openjdk-amd64/jre/lib/security/java.security
20+
21+
#======================================
22+
# Add Grid check script
23+
#======================================
24+
COPY check-grid.sh entry_point.sh /opt/bin/
25+
26+
#===================================================
27+
# Run the following commands as non-privileged user
28+
#===================================================
29+
USER seluser
30+
31+
32+
CMD ["/opt/bin/entry_point.sh"]

GridBase/Dockerfile.txt

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
USER root
2+
3+
#========================
4+
# Miscellaneous packages
5+
# Includes minimal runtime used for executing non GUI Java programs
6+
#========================
7+
RUN apt-get update -qqy \
8+
&& apt-get -qqy --no-install-recommends install \
9+
# OpenJDK Java runtime, using Hotspot JIT (headless) - https://packages.ubuntu.com/bionic/openjdk-8-jre-headless
10+
openjdk-8-jre-headless \
11+
&& rm -rf /var/lib/apt/lists/* /var/cache/apt/* \
12+
&& sed -i 's/securerandom\.source=file:\/dev\/random/securerandom\.source=file:\/dev\/urandom/' ./usr/lib/jvm/java-8-openjdk-amd64/jre/lib/security/java.security
13+
14+
#======================================
15+
# Add Grid check script
16+
#======================================
17+
COPY check-grid.sh entry_point.sh /opt/bin/
18+
19+
#===================================================
20+
# Run the following commands as non-privileged user
21+
#===================================================
22+
USER seluser
23+
24+
25+
CMD ["/opt/bin/entry_point.sh"]

GridBase/README-short.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
_This image is not meant to be run directly!_ It serves as the base image used for each of the Selenium images involved in setting up a Selenium Grid.

GridBase/README.md

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# Selenium Base Image
2+
3+
_This image is not meant to be run directly!_ It serves as the base image used for each of the Selenium images involved in setting up a Selenium Grid.
4+
5+
## Dockerfile
6+
7+
[`selenium/base` Dockerfile](https://github.com/SeleniumHQ/docker-selenium/blob/master/Base/Dockerfile)
8+
9+
## What is Selenium?
10+
_Selenium automates browsers._ That's it! What you do with that power is entirely up to you. Primarily, it is for automating web applications for testing purposes, but is certainly not limited to just that. Boring web-based administration tasks can (and should!) also be automated as well.
11+
12+
Selenium has the support of some of the largest browser vendors who have taken (or are taking) steps to make Selenium a native part of their browser. It is also the core technology in countless other browser automation tools, APIs and frameworks.
13+
14+
See the Selenium [site](http://docs.seleniumhq.org/) for documation on usage within your test code.
15+
16+
## License
17+
18+
View [license information](https://github.com/SeleniumHQ/docker-selenium/blob/master/LICENSE.md) for the software contained in this image.
19+
20+
## Getting Help
21+
22+
### User Group
23+
24+
The first place where people ask for help about Selenium is the [Official User Group](https://groups.google.com/forum/#!forum/selenium-users). Here, you'll find that most of the time, someone already found the problem you are facing right now, and usually reached the solution for which you are looking.
25+
26+
_Note: Please make sure to search the group before asking for something. Your question likely won't get answered if it was previously answered in another discussion!_
27+
28+
### Chat Room
29+
30+
The best place to ask for help is the user group (because they also keep the information accessible for others to read in the future). However, if you have a very important (or too simple) issue that needs a solution ASAP, you can always enter the IRC chat room. You might just find someone ready to help on `#selenium` at [Freenode](https://freenode.net/) or [SeleniumHQ Slack](https://seleniumhq.herokuapp.com/)
31+
32+
### Issues
33+
34+
If you have any problems with or questions about this image, please contact us through a [Github issue](https://github.com/SeleniumHQ/docker-selenium/issues). If you have any problems with or questions about Selenium, please contact us through Selenium's [Bug Tracker](https://github.com/SeleniumHQ/selenium/issues).
35+
36+
## Contributing
37+
38+
There are many ways to [contribute](http://docs.seleniumhq.org/about/getting-involved.jsp) whether by answering user questions, additional docs, or pull request we look forward to hearing from you.
39+
40+
If you do supply a patch we will need you to [sign the CLA](https://spreadsheets.google.com/spreadsheet/viewform?hl=en_US&formkey=dFFjXzBzM1VwekFlOWFWMjFFRjJMRFE6MQ#gid=0). We are part of [SFC](http://www.sfconservancy.org/)
File renamed without changes.

GridBase/entry_point.sh

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
#!/usr/bin/env bash
2+
3+
#==============================================
4+
# OpenShift or non-sudo environments support
5+
# https://docs.openshift.com/container-platform/3.11/creating_images/guidelines.html#openshift-specific-guidelines
6+
#==============================================
7+
8+
if ! whoami &> /dev/null; then
9+
if [ -w /etc/passwd ]; then
10+
echo "${USER_NAME:-default}:x:$(id -u):0:${USER_NAME:-default} user:${HOME}:/sbin/nologin" >> /etc/passwd
11+
fi
12+
fi
13+
14+
/usr/bin/supervisord --configuration /etc/supervisord.conf &
15+
16+
SUPERVISOR_PID=$!
17+
18+
function shutdown {
19+
echo "Trapped SIGTERM/SIGINT/x so shutting down supervisord..."
20+
kill -s SIGTERM ${SUPERVISOR_PID}
21+
wait ${SUPERVISOR_PID}
22+
echo "Shutdown complete"
23+
}
24+
25+
trap shutdown SIGTERM SIGINT
26+
wait ${SUPERVISOR_PID}

GridBase/generate.sh

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#!/usr/bin/env bash
2+
3+
VERSION=$1
4+
NAMESPACE=$2
5+
AUTHORS=$3
6+
7+
echo "# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" > ./Dockerfile
8+
echo "# NOTE: DO *NOT* EDIT THIS FILE. IT IS GENERATED." >> ./Dockerfile
9+
echo "# PLEASE UPDATE Dockerfile.txt INSTEAD OF THIS FILE" >> ./Dockerfile
10+
echo "# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" >> ./Dockerfile
11+
echo FROM ${NAMESPACE}/base:${VERSION} >> ./Dockerfile
12+
echo LABEL authors="$AUTHORS" >> ./Dockerfile
13+
echo "" >> ./Dockerfile
14+
cat ./Dockerfile.txt >> ./Dockerfile

GridBase/supervisord.conf

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
; Documentation of this file format -> http://supervisord.org/configuration.html
2+
3+
[supervisord]
4+
childlogdir=/var/log/supervisor ; ('AUTO' child log dir, default $TEMP)
5+
logfile=/var/log/supervisor/supervisord.log ; (main log file;default $CWD/supervisord.log)
6+
logfile_maxbytes=50MB ; (max main logfile bytes b4 rotation;default 50MB)
7+
logfile_backups=10 ; (num of main logfile rotation backups;default 10)
8+
loglevel=info ; (log level;default info; others: debug,warn,trace)
9+
pidfile=/var/run/supervisor/supervisord.pid ; (supervisord pidfile;default supervisord.pid)
10+
nodaemon=true ; (start in foreground if true;default false)
11+
minfds=1024 ; (min. avail startup file descriptors;default 1024)
12+
minprocs=200 ; (min. avail process descriptors;default 200)
13+
14+
[include]
15+
files = /etc/supervisor/conf.d/*.conf

Hub/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# NOTE: DO *NOT* EDIT THIS FILE. IT IS GENERATED.
33
# PLEASE UPDATE Dockerfile.txt INSTEAD OF THIS FILE
44
# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
5-
FROM selenium/base:4.0.0-alpha-5-20200326
5+
FROM selenium/grid-base:4.0.0-alpha-5-20200326
66
LABEL authors=SeleniumHQ
77

88
USER seluser

0 commit comments

Comments
 (0)