├── .gitignore ├── NodeChromium ├── README-short.txt ├── wrap_chrome_binary ├── generate.sh ├── generate_config ├── Dockerfile ├── Dockerfile.txt └── README.md ├── StandaloneChromium ├── README-short.txt ├── start-selenium-standalone.sh ├── Dockerfile ├── selenium.conf └── README.md ├── Base ├── qemu-arm-static ├── README-short.txt ├── check-grid.sh ├── entry_point.sh ├── supervisord.conf ├── README.md └── Dockerfile ├── NodeBase ├── README-short.txt ├── start-xvfb.sh ├── generate.sh ├── selenium.conf ├── start-selenium-node.sh ├── README.md ├── Dockerfile.txt └── Dockerfile ├── Hub ├── README-short.txt ├── selenium-hub.conf ├── start-selenium-hub.sh ├── generate.sh ├── generate_config ├── Dockerfile.txt ├── Dockerfile └── README.md ├── README.md └── LICENSE.txt /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | .idea 3 | -------------------------------------------------------------------------------- /NodeChromium/README-short.txt: -------------------------------------------------------------------------------- 1 | Selenium Node configured to run Google Chrome. 2 | -------------------------------------------------------------------------------- /StandaloneChromium/README-short.txt: -------------------------------------------------------------------------------- 1 | Selenium Standalone configured to run Chrome 2 | -------------------------------------------------------------------------------- /Base/qemu-arm-static: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kynetiv/docker-selenium-pi/HEAD/Base/qemu-arm-static -------------------------------------------------------------------------------- /NodeBase/README-short.txt: -------------------------------------------------------------------------------- 1 | _This image is not meant to be run directly!_ It serves as the base image used for Selenium Nodes. 2 | -------------------------------------------------------------------------------- /Hub/README-short.txt: -------------------------------------------------------------------------------- 1 | The Hub manages Nodes that can perform tests. When it receives a test to be executed, that responsibility is delegated to a Node that can do so. 2 | -------------------------------------------------------------------------------- /Base/README-short.txt: -------------------------------------------------------------------------------- 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. 2 | -------------------------------------------------------------------------------- /StandaloneChromium/start-selenium-standalone.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # 3 | # IMPORTANT: Change this file only in directory Standalone! 4 | 5 | java ${JAVA_OPTS} -jar /opt/selenium/selenium-server-standalone.jar \ 6 | ${SE_OPTS} 7 | -------------------------------------------------------------------------------- /NodeChromium/wrap_chrome_binary: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | WRAPPER_PATH=$(readlink -f /usr/bin/chromium-browser) 4 | BASE_PATH="$WRAPPER_PATH-base" 5 | mv "$WRAPPER_PATH" "$BASE_PATH" 6 | 7 | cat > "$WRAPPER_PATH" <<_EOF 8 | #!/bin/bash 9 | 10 | # Note: exec -a below is a bashism. 11 | exec -a "\$0" "$BASE_PATH" --no-sandbox "\$@" 12 | _EOF 13 | chmod +x "$WRAPPER_PATH" 14 | -------------------------------------------------------------------------------- /NodeBase/start-xvfb.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | if [ "${START_XVFB}" = true ] ; then 4 | export GEOMETRY="${SCREEN_WIDTH}""x""${SCREEN_HEIGHT}""x""${SCREEN_DEPTH}" 5 | 6 | rm -f /tmp/.X*lock 7 | 8 | /usr/bin/Xvfb ${DISPLAY} -screen 0 ${GEOMETRY} -ac +extension RANDR 9 | else 10 | echo "Xvfb won't start. Chrome/Firefox can only run in headless mode. Remember to set the 'headless' flag in your test." 11 | fi 12 | -------------------------------------------------------------------------------- /Hub/selenium-hub.conf: -------------------------------------------------------------------------------- 1 | ; Documentation of this file format -> http://supervisord.org/configuration.html 2 | 3 | [program:selenium-hub] 4 | 5 | priority=0 6 | command=/opt/bin/start-selenium-hub.sh 7 | autostart=true 8 | autorestart=false 9 | startsecs=0 10 | startretries=0 11 | 12 | ;Logs (all Hub activity redirected to stdout so it can be seen through "docker logs" 13 | redirect_stderr=true 14 | stdout_logfile=/dev/stdout 15 | stdout_logfile_maxbytes=0 16 | -------------------------------------------------------------------------------- /StandaloneChromium/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM kynetiv/selenium-node-chromium-pi:3.141.59-dubnium 2 | 3 | USER seluser 4 | 5 | #==================================== 6 | # Scripts to run Selenium Standalone 7 | #==================================== 8 | COPY start-selenium-standalone.sh /opt/bin/start-selenium-standalone.sh 9 | 10 | #============================== 11 | # Supervisor configuration file 12 | #============================== 13 | COPY selenium.conf /etc/supervisor/conf.d/ 14 | 15 | 16 | EXPOSE 4444 17 | -------------------------------------------------------------------------------- /Hub/start-selenium-hub.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # set -e: exit asap if a command exits with a non-zero status 4 | set -e 5 | 6 | ROOT=/opt/selenium 7 | CONF=${ROOT}/config.json 8 | 9 | /opt/bin/generate_config >${CONF} 10 | 11 | echo "Starting Selenium Hub with configuration:" 12 | cat ${CONF} 13 | 14 | if [ ! -z "$SE_OPTS" ]; then 15 | echo "Appending Selenium options: ${SE_OPTS}" 16 | fi 17 | 18 | java ${JAVA_OPTS} -jar /opt/selenium/selenium-server-standalone.jar \ 19 | -role hub \ 20 | -hubConfig ${CONF} \ 21 | ${SE_OPTS} 22 | -------------------------------------------------------------------------------- /NodeBase/generate.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | VERSION=$1 3 | NAMESPACE=$2 4 | AUTHORS=$3 5 | 6 | echo "# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" > ./Dockerfile 7 | echo "# NOTE: DO *NOT* EDIT THIS FILE. IT IS GENERATED." >> ./Dockerfile 8 | echo "# PLEASE UPDATE Dockerfile.txt INSTEAD OF THIS FILE" >> ./Dockerfile 9 | echo "# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" >> ./Dockerfile 10 | echo FROM ${NAMESPACE}/base:${VERSION} >> ./Dockerfile 11 | echo LABEL authors="$AUTHORS" >> ./Dockerfile 12 | echo "" >> ./Dockerfile 13 | cat ./Dockerfile.txt >> ./Dockerfile 14 | -------------------------------------------------------------------------------- /Base/check-grid.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # check-grid.sh 3 | 4 | set -e 5 | 6 | HOST="localhost" 7 | PORT="4444" 8 | 9 | # process arguments 10 | while [[ $# -gt 0 ]] 11 | do 12 | case "$1" in 13 | --host) 14 | HOST=${2:-"localhost"} 15 | shift 2 16 | ;; 17 | --port) 18 | PORT=${2:-"4444"} 19 | shift 2 20 | ;; 21 | *) 22 | echoerr "Unknown argument: $1" 23 | ;; 24 | esac 25 | done 26 | 27 | curl -sSL http://${HOST}:${PORT}/wd/hub/status | jq -r '.value.ready' | grep "true" || exit 1 28 | -------------------------------------------------------------------------------- /Hub/generate.sh: -------------------------------------------------------------------------------- 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 15 | -------------------------------------------------------------------------------- /NodeChromium/generate.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | VERSION=$1 3 | NAMESPACE=$2 4 | AUTHORS=$3 5 | 6 | echo "# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" > ./Dockerfile 7 | echo "# NOTE: DO *NOT* EDIT THIS FILE. IT IS GENERATED." >> ./Dockerfile 8 | echo "# PLEASE UPDATE Dockerfile.txt INSTEAD OF THIS FILE" >> ./Dockerfile 9 | echo "# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" >> ./Dockerfile 10 | echo FROM ${NAMESPACE}/node-base:${VERSION} >> ./Dockerfile 11 | echo LABEL authors="$AUTHORS" >> ./Dockerfile 12 | echo "" >> ./Dockerfile 13 | cat ./Dockerfile.txt >> ./Dockerfile 14 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Docker Selenium Pi 2 | 3 | The project is thanks to the great work by [SeleniumHQ/docker-selenium](https://github.com/SeleniumHQ/docker-selenium). 4 | 5 | Currently a limited port mostly to include a StandaloneChrome (Chromium Browser) version that runs on the Raspberry Pi 2/3/4. 6 | 7 | ### See Docker Hub for more details 8 | 9 | #### Docker Standalone-Chromium image: 10 | [kynetiv/selenium-standalone-chromium-pi](https://cloud.docker.com/repository/docker/kynetiv/selenium-standalone-chromium-pi/) 11 | 12 | tags: 13 | 14 | - `3.141.59-dubnium`, `latest` 15 | - `3.4.0` (Einsteinium) 16 | 17 | -------------------------------------------------------------------------------- /Hub/generate_config: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | cat <<_EOF 4 | { 5 | "host": "${GRID_HUB_HOST}", 6 | "port": ${GRID_HUB_PORT}, 7 | "role": "hub", 8 | "maxSession": ${GRID_MAX_SESSION}, 9 | "newSessionWaitTimeout": ${GRID_NEW_SESSION_WAIT_TIMEOUT}, 10 | "capabilityMatcher": "org.openqa.grid.internal.utils.DefaultCapabilityMatcher", 11 | "throwOnCapabilityNotPresent": ${GRID_THROW_ON_CAPABILITY_NOT_PRESENT}, 12 | "jettyMaxThreads": ${GRID_JETTY_MAX_THREADS}, 13 | "cleanUpCycle": ${GRID_CLEAN_UP_CYCLE}, 14 | "browserTimeout": ${GRID_BROWSER_TIMEOUT}, 15 | "timeout": ${GRID_TIMEOUT}, 16 | "debug": ${GRID_DEBUG} 17 | } 18 | _EOF 19 | -------------------------------------------------------------------------------- /NodeChromium/generate_config: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | CHROME_VERSION=$(/usr/bin/chromium-browser -version | awk '{ print $3 }') 4 | 5 | cat <<_EOF 6 | { 7 | "capabilities": [ 8 | { 9 | "version": "$CHROME_VERSION", 10 | "browserName": "chrome", 11 | "maxInstances": $NODE_MAX_INSTANCES, 12 | "seleniumProtocol": "WebDriver", 13 | "applicationName": "$NODE_APPLICATION_NAME" 14 | } 15 | ], 16 | "proxy": "org.openqa.grid.selenium.proxy.DefaultRemoteProxy", 17 | "maxSession": $NODE_MAX_SESSION, 18 | "host": "$NODE_HOST", 19 | "port": $NODE_PORT, 20 | "register": true, 21 | "registerCycle": $NODE_REGISTER_CYCLE, 22 | "nodePolling": $NODE_POLLING, 23 | "unregisterIfStillDownAfter": $NODE_UNREGISTER_IF_STILL_DOWN_AFTER, 24 | "downPollingLimit": $NODE_DOWN_POLLING_LIMIT, 25 | "debug": $GRID_DEBUG 26 | } 27 | _EOF 28 | -------------------------------------------------------------------------------- /Base/entry_point.sh: -------------------------------------------------------------------------------- 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} 27 | -------------------------------------------------------------------------------- /Base/supervisord.conf: -------------------------------------------------------------------------------- 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 16 | -------------------------------------------------------------------------------- /Hub/Dockerfile.txt: -------------------------------------------------------------------------------- 1 | USER seluser 2 | 3 | #======================== 4 | # Selenium Configuration 5 | #======================== 6 | 7 | EXPOSE 4444 8 | 9 | # As integer, maps to "maxSession" 10 | ENV GRID_MAX_SESSION 5 11 | # In milliseconds, maps to "newSessionWaitTimeout" 12 | ENV GRID_NEW_SESSION_WAIT_TIMEOUT -1 13 | # As a boolean, maps to "throwOnCapabilityNotPresent" 14 | ENV GRID_THROW_ON_CAPABILITY_NOT_PRESENT true 15 | # As an integer 16 | ENV GRID_JETTY_MAX_THREADS -1 17 | # In milliseconds, maps to "cleanUpCycle" 18 | ENV GRID_CLEAN_UP_CYCLE 5000 19 | # In seconds, maps to "browserTimeout" 20 | ENV GRID_BROWSER_TIMEOUT 0 21 | # In seconds, maps to "timeout" 22 | ENV GRID_TIMEOUT 1800 23 | # Debug 24 | ENV GRID_DEBUG false 25 | # As integer, maps to "port" 26 | ENV GRID_HUB_PORT 4444 27 | # As string, maps to "host" 28 | ENV GRID_HUB_HOST "0.0.0.0" 29 | 30 | COPY generate_config \ 31 | start-selenium-hub.sh \ 32 | /opt/bin/ 33 | 34 | COPY selenium-hub.conf /etc/supervisor/conf.d/ 35 | 36 | RUN /opt/bin/generate_config > /opt/selenium/config.json 37 | -------------------------------------------------------------------------------- /NodeBase/selenium.conf: -------------------------------------------------------------------------------- 1 | ; Documentation of this file format -> http://supervisord.org/configuration.html 2 | 3 | ; Priority 0 - xvfb, 5 - fluxbox (debug images), 10 - x11vnc (debug images), 15 - selenium-node 4 | 5 | [program:xvfb] 6 | priority=0 7 | command=/opt/bin/start-xvfb.sh 8 | autostart=true 9 | autorestart=false 10 | startsecs=0 11 | startretries=0 12 | 13 | ;Logs 14 | redirect_stderr=false 15 | stdout_logfile=/var/log/supervisor/xvfb-stdout.log 16 | stderr_logfile=/var/log/supervisor/xvfb-stderr.log 17 | stdout_logfile_maxbytes=50MB 18 | stderr_logfile_maxbytes=50MB 19 | stdout_logfile_backups=5 20 | stderr_logfile_backups=5 21 | stdout_capture_maxbytes=50MB 22 | stderr_capture_maxbytes=50MB 23 | 24 | 25 | [program:selenium-node] 26 | priority=15 27 | command=/opt/bin/start-selenium-node.sh 28 | autostart=true 29 | autorestart=false 30 | startsecs=0 31 | startretries=0 32 | 33 | ;Logs (all Hub activity redirected to stdout so it can be seen through "docker logs" 34 | redirect_stderr=true 35 | stdout_logfile=/dev/stdout 36 | stdout_logfile_maxbytes=0 37 | -------------------------------------------------------------------------------- /StandaloneChromium/selenium.conf: -------------------------------------------------------------------------------- 1 | ; Documentation of this file format -> http://supervisord.org/configuration.html 2 | 3 | ; Priority 0 - xvfb, 5 - fluxbox (debug images), 10 - x11vnc (debug images), 15 - selenium-node 4 | 5 | [program:xvfb] 6 | priority=0 7 | command=/opt/bin/start-xvfb.sh 8 | autostart=true 9 | autorestart=false 10 | startsecs=0 11 | startretries=0 12 | 13 | ;Logs 14 | redirect_stderr=false 15 | stdout_logfile=/var/log/supervisor/xvfb-stdout.log 16 | stderr_logfile=/var/log/supervisor/xvfb-stderr.log 17 | stdout_logfile_maxbytes=50MB 18 | stderr_logfile_maxbytes=50MB 19 | stdout_logfile_backups=5 20 | stderr_logfile_backups=5 21 | stdout_capture_maxbytes=50MB 22 | stderr_capture_maxbytes=50MB 23 | 24 | 25 | [program:selenium-standalone] 26 | priority=15 27 | command=/opt/bin/start-selenium-standalone.sh 28 | autostart=true 29 | autorestart=false 30 | startsecs=0 31 | startretries=0 32 | 33 | ;Logs (all Hub activity redirected to stdout so it can be seen through "docker logs" 34 | redirect_stderr=true 35 | stdout_logfile=/dev/stdout 36 | stdout_logfile_maxbytes=0 37 | -------------------------------------------------------------------------------- /Hub/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM kynetiv/selenium-base-pi:3.141.59-dubnium 2 | 3 | USER seluser 4 | 5 | #======================== 6 | # Selenium Configuration 7 | #======================== 8 | 9 | EXPOSE 4444 10 | 11 | # As integer, maps to "maxSession" 12 | ENV GRID_MAX_SESSION 5 13 | # In milliseconds, maps to "newSessionWaitTimeout" 14 | ENV GRID_NEW_SESSION_WAIT_TIMEOUT -1 15 | # As a boolean, maps to "throwOnCapabilityNotPresent" 16 | ENV GRID_THROW_ON_CAPABILITY_NOT_PRESENT true 17 | # As an integer 18 | ENV GRID_JETTY_MAX_THREADS -1 19 | # In milliseconds, maps to "cleanUpCycle" 20 | ENV GRID_CLEAN_UP_CYCLE 5000 21 | # In seconds, maps to "browserTimeout" 22 | ENV GRID_BROWSER_TIMEOUT 0 23 | # In seconds, maps to "timeout" 24 | ENV GRID_TIMEOUT 1800 25 | # Debug 26 | ENV GRID_DEBUG false 27 | # As integer, maps to "port" 28 | ENV GRID_HUB_PORT 4444 29 | # As string, maps to "host" 30 | ENV GRID_HUB_HOST "0.0.0.0" 31 | 32 | COPY generate_config \ 33 | start-selenium-hub.sh \ 34 | /opt/bin/ 35 | 36 | COPY selenium-hub.conf /etc/supervisor/conf.d/ 37 | 38 | RUN /opt/bin/generate_config > /opt/selenium/config.json 39 | -------------------------------------------------------------------------------- /NodeBase/start-selenium-node.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | /opt/bin/generate_config > /opt/selenium/config.json 4 | 5 | if [ ! -e /opt/selenium/config.json ]; then 6 | echo No Selenium Node configuration file, the node-base image is not intended to be run directly. 1>&2 7 | exit 1 8 | fi 9 | 10 | # In the long term the idea is to remove $HUB_PORT_4444_TCP_ADDR and $HUB_PORT_4444_TCP_PORT and only work with 11 | # $HUB_HOST and $HUB_PORT 12 | if [ ! -z "$HUB_HOST" ]; then 13 | HUB_PORT_PARAM=4444 14 | if [ ! -z "$HUB_PORT" ]; then 15 | HUB_PORT_PARAM=${HUB_PORT} 16 | fi 17 | echo "Connecting to the Hub using the host ${HUB_HOST} and port ${HUB_PORT_PARAM}" 18 | HUB_PORT_4444_TCP_ADDR=${HUB_HOST} 19 | HUB_PORT_4444_TCP_PORT=${HUB_PORT_PARAM} 20 | fi 21 | 22 | if [ -z "$HUB_PORT_4444_TCP_ADDR" ]; then 23 | echo "Not linked with a running Hub container" 1>&2 24 | exit 1 25 | fi 26 | 27 | REMOTE_HOST_PARAM="" 28 | if [ ! -z "$REMOTE_HOST" ]; then 29 | echo "REMOTE_HOST variable is set, appending -remoteHost" 30 | REMOTE_HOST_PARAM="-remoteHost $REMOTE_HOST" 31 | fi 32 | 33 | if [ ! -z "$SE_OPTS" ]; then 34 | echo "appending selenium options: ${SE_OPTS}" 35 | fi 36 | 37 | rm -f /tmp/.X*lock 38 | 39 | java ${JAVA_OPTS} -jar /opt/selenium/selenium-server-standalone.jar \ 40 | -role node \ 41 | -hub http://$HUB_PORT_4444_TCP_ADDR:$HUB_PORT_4444_TCP_PORT/grid/register \ 42 | ${REMOTE_HOST_PARAM} \ 43 | -nodeConfig /opt/selenium/config.json \ 44 | ${SE_OPTS} 45 | 46 | -------------------------------------------------------------------------------- /NodeChromium/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM kynetiv/selenium-node-base-pi:3.141.59-dubnium 2 | 3 | USER root 4 | 5 | #============================================ 6 | # Chromium Broswer and Chromium Chrome Driver 7 | #============================================ 8 | RUN apt-get update -qqy \ 9 | && apt-get -qqy install \ 10 | chromium-browser \ 11 | chromium-chromedriver \ 12 | && rm -rf /var/lib/apt/lists/* /var/cache/apt/* 13 | 14 | #================================= 15 | # Chrome Launch Script Wrapper 16 | #================================= 17 | COPY wrap_chrome_binary /opt/bin/wrap_chrome_binary 18 | RUN /opt/bin/wrap_chrome_binary 19 | 20 | USER seluser 21 | 22 | #============================================ 23 | # Chrome webdriver 24 | #============================================ 25 | # linking chromium-chromedriver to where chromedriver would be in path 26 | # this avoids needing to set custom binary paths 27 | RUN sudo ln -fs /usr/lib/chromium-browser/chromedriver /usr/bin/chromedriver 28 | 29 | 30 | # We install the available chromium chromedriver above with browser 31 | # commenting out for reference 32 | #============================================ 33 | #ARG CHROME_DRIVER_VERSION="latest" 34 | #RUN CD_VERSION=$(if [ ${CHROME_DRIVER_VERSION:-latest} = "latest" ]; then echo $(wget -qO- https://chromedriver.storage.googleapis.com/LATEST_RELEASE); else echo $CHROME_DRIVER_VERSION; fi) \ 35 | # && echo "Using chromedriver version: "$CD_VERSION \ 36 | # && wget --no-verbose -O /tmp/chromedriver_linux64.zip https://chromedriver.storage.googleapis.com/$CD_VERSION/chromedriver_linux64.zip \ 37 | # && rm -rf /opt/selenium/chromedriver \ 38 | # && unzip /tmp/chromedriver_linux64.zip -d /opt/selenium \ 39 | # && rm /tmp/chromedriver_linux64.zip \ 40 | # && mv /opt/selenium/chromedriver /opt/selenium/chromedriver-$CD_VERSION \ 41 | # && chmod 755 /opt/selenium/chromedriver-$CD_VERSION \ 42 | # && sudo ln -fs /opt/selenium/chromedriver-$CD_VERSION /usr/bin/chromedriver 43 | 44 | COPY generate_config /opt/bin/generate_config 45 | 46 | # Generating a default config during build time 47 | RUN /opt/bin/generate_config > /opt/selenium/config.json 48 | -------------------------------------------------------------------------------- /NodeChromium/Dockerfile.txt: -------------------------------------------------------------------------------- 1 | USER root 2 | 3 | #============================================ 4 | # Google Chrome 5 | #============================================ 6 | # can specify versions by CHROME_VERSION; 7 | # e.g. google-chrome-stable=53.0.2785.101-1 8 | # google-chrome-beta=53.0.2785.92-1 9 | # google-chrome-unstable=54.0.2840.14-1 10 | # latest (equivalent to google-chrome-stable) 11 | # google-chrome-beta (pull latest beta) 12 | #============================================ 13 | ARG CHROME_VERSION="google-chrome-stable" 14 | RUN wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add - \ 15 | && echo "deb http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google-chrome.list \ 16 | && apt-get update -qqy \ 17 | && apt-get -qqy install \ 18 | ${CHROME_VERSION:-google-chrome-stable} \ 19 | && rm /etc/apt/sources.list.d/google-chrome.list \ 20 | && rm -rf /var/lib/apt/lists/* /var/cache/apt/* 21 | 22 | #================================= 23 | # Chrome Launch Script Wrapper 24 | #================================= 25 | COPY wrap_chrome_binary /opt/bin/wrap_chrome_binary 26 | RUN /opt/bin/wrap_chrome_binary 27 | 28 | USER seluser 29 | 30 | #============================================ 31 | # Chrome webdriver 32 | #============================================ 33 | # can specify versions by CHROME_DRIVER_VERSION 34 | # Latest released version will be used by default 35 | #============================================ 36 | ARG CHROME_DRIVER_VERSION="latest" 37 | RUN CD_VERSION=$(if [ ${CHROME_DRIVER_VERSION:-latest} = "latest" ]; then echo $(wget -qO- https://chromedriver.storage.googleapis.com/LATEST_RELEASE); else echo $CHROME_DRIVER_VERSION; fi) \ 38 | && echo "Using chromedriver version: "$CD_VERSION \ 39 | && wget --no-verbose -O /tmp/chromedriver_linux64.zip https://chromedriver.storage.googleapis.com/$CD_VERSION/chromedriver_linux64.zip \ 40 | && rm -rf /opt/selenium/chromedriver \ 41 | && unzip /tmp/chromedriver_linux64.zip -d /opt/selenium \ 42 | && rm /tmp/chromedriver_linux64.zip \ 43 | && mv /opt/selenium/chromedriver /opt/selenium/chromedriver-$CD_VERSION \ 44 | && chmod 755 /opt/selenium/chromedriver-$CD_VERSION \ 45 | && sudo ln -fs /opt/selenium/chromedriver-$CD_VERSION /usr/bin/chromedriver 46 | 47 | COPY generate_config /opt/bin/generate_config 48 | 49 | # Generating a default config during build time 50 | RUN /opt/bin/generate_config > /opt/selenium/config.json 51 | -------------------------------------------------------------------------------- /NodeBase/README.md: -------------------------------------------------------------------------------- 1 | # Selenium Grid Node Base 2 | 3 | _This image is not meant to be run directly!_ It serves as the base image used for Selenium Nodes. 4 | 5 | ## Dockerfile 6 | 7 | [`selenium/node-base` Dockerfile](https://github.com/SeleniumHQ/docker-selenium/blob/master/NodeBase/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/) 41 | -------------------------------------------------------------------------------- /Base/README.md: -------------------------------------------------------------------------------- 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/) 41 | -------------------------------------------------------------------------------- /StandaloneChromium/README.md: -------------------------------------------------------------------------------- 1 | # Selenium Grid Standalone - Chrome 2 | 3 | Selenium Standalone Server with Chrome 4 | 5 | ## Dockerfile 6 | 7 | [`selenium/standalone-chrome` Dockerfile](https://github.com/SeleniumHQ/docker-selenium/blob/master/StandaloneChrome/Dockerfile) 8 | 9 | ## How to use this image 10 | 11 | 12 | ``` 13 | $ docker run -d -p 4444:4444 -v /dev/shm:/dev/shm selenium/standalone-chrome 14 | ``` 15 | 16 | ## What is Selenium? 17 | _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. 18 | 19 | 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. 20 | 21 | See the Selenium [site](http://docs.seleniumhq.org/) for documation on usage within your test code. 22 | 23 | ## License 24 | 25 | View [license information](https://github.com/SeleniumHQ/docker-selenium/blob/master/LICENSE.md) for the software contained in this image. 26 | 27 | ## Getting Help 28 | 29 | ### User Group 30 | 31 | 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. 32 | 33 | _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!_ 34 | 35 | ### Chat Room 36 | 37 | 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/) 38 | 39 | ### Issues 40 | 41 | 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). 42 | 43 | ## Contributing 44 | 45 | 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. 46 | 47 | 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/) 48 | -------------------------------------------------------------------------------- /NodeChromium/README.md: -------------------------------------------------------------------------------- 1 | # Selenium Grid Node - Chrome 2 | 3 | Selenium Node configured to run Google Chrome. 4 | 5 | ## Dockerfile 6 | 7 | [`selenium/node-chrome` Dockerfile](https://github.com/SeleniumHQ/docker-selenium/blob/master/NodeChrome/Dockerfile) 8 | 9 | ## How to use this image 10 | 11 | First, you will need a Selenium Grid Hub that the Node will connect to. 12 | 13 | ``` 14 | $ docker run -d -p 4444:4444 --name selenium-hub selenium/hub 15 | ``` 16 | 17 | Once the hub is up and running will want to launch nodes that can run tests. You can run as many nodes as you wish. 18 | 19 | ``` 20 | $ docker run -d --link selenium-hub:hub -v /dev/shm:/dev/shm selenium/node-chrome 21 | ``` 22 | 23 | ## What is Selenium? 24 | _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. 25 | 26 | 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. 27 | 28 | See the Selenium [site](http://docs.seleniumhq.org/) for documation on usage within your test code. 29 | 30 | ## License 31 | 32 | View [license information](https://github.com/SeleniumHQ/docker-selenium/blob/master/LICENSE.md) for the software contained in this image. 33 | 34 | ## Getting Help 35 | 36 | ### User Group 37 | 38 | 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. 39 | 40 | _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!_ 41 | 42 | ### Chat Room 43 | 44 | 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/) 45 | 46 | ### Issues 47 | 48 | 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). 49 | 50 | ## Contributing 51 | 52 | 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. 53 | 54 | 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/) 55 | -------------------------------------------------------------------------------- /Hub/README.md: -------------------------------------------------------------------------------- 1 | # Selenium Grid Hub 2 | 3 | The Hub receives a test to be executed along with information on which browser and 'platform' where the test should be run. The hub will use this information and delegate to a node that can service those needs. 4 | 5 | ## Dockerfile 6 | 7 | [`selenium/hub` Dockerfile](https://github.com/SeleniumHQ/docker-selenium/blob/master/Hub/Dockerfile) 8 | 9 | ## How to use this image 10 | 11 | ``` 12 | $ docker run -d -p 4444:4444 --name selenium-hub selenium/hub 13 | ``` 14 | 15 | Note: You can optionally override default configuration settings using environment variables. 16 | See the [Hub's Dockerfile](Dockerfile) to view the list of variables and their default values. 17 | 18 | ``` 19 | $ docker run -d -p 4444:4444 --name selenium-hub -e GRID_TIMEOUT=10 selenium/hub 20 | ``` 21 | 22 | 23 | Once the hub is up and running will want to launch nodes that can run tests. You can run as many nodes as you wish. 24 | 25 | ``` 26 | $ docker run -d --link selenium-hub:hub -v /dev/shm:/dev/shm selenium/node-chrome 27 | $ docker run -d --link selenium-hub:hub -v /dev/shm:/dev/shm selenium/node-firefox 28 | ``` 29 | 30 | ## What is Selenium? 31 | _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. 32 | 33 | 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. 34 | 35 | See the Selenium [site](http://docs.seleniumhq.org/) for documation on usage within your test code. 36 | 37 | ## License 38 | 39 | View [license information](https://github.com/SeleniumHQ/docker-selenium/blob/master/LICENSE.md) for the software contained in this image. 40 | 41 | ## Getting Help 42 | 43 | ### User Group 44 | 45 | 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. 46 | 47 | _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!_ 48 | 49 | ### Chat Room 50 | 51 | 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/) 52 | 53 | ### Issues 54 | 55 | 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). 56 | 57 | ## Contributing 58 | 59 | 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. 60 | 61 | 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/) 62 | -------------------------------------------------------------------------------- /Base/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM arm32v7/ubuntu:18.04 2 | #================================================ 3 | # Customize sources for apt-get 4 | #================================================ 5 | #RUN echo "deb http://ports.ubuntu.com/ubuntu-ports xenial main universe\n" > /etc/apt/sources.list \ 6 | # && echo "deb http://ports.ubuntu.com/ubuntu-ports xenial-updates main universe\n" >> /etc/apt/sources.list \ 7 | # && echo "deb http://ports.ubuntu.com/ubuntu-ports xenial-security main universe\n" >> /etc/apt/sources.list 8 | 9 | # No interactive frontend during docker build 10 | ENV DEBIAN_FRONTEND=noninteractive \ 11 | DEBCONF_NONINTERACTIVE_SEEN=true 12 | 13 | 14 | #======================== 15 | # Miscellaneous packages 16 | # Includes minimal runtime used for executing non GUI Java programs 17 | #======================== 18 | 19 | RUN apt-get -qqy update \ 20 | && apt-get -qqy --no-install-recommends install \ 21 | ca-certificates \ 22 | && apt-get -qqy --no-install-recommends install \ 23 | bzip2 \ 24 | tzdata \ 25 | sudo \ 26 | unzip \ 27 | wget \ 28 | jq \ 29 | curl \ 30 | supervisor \ 31 | ca-certificates-java \ 32 | && sh -c "/var/lib/dpkg/info/ca-certificates-java.postinst configure" \ 33 | && apt-get -qqy --no-install-recommends install \ 34 | openjdk-8-jre-headless \ 35 | && rm -rf /var/lib/apt/lists/* /var/cache/apt/* \ 36 | && sed -i 's/securerandom\.source=file:\/dev\/random/securerandom\.source=file:\/dev\/urandom/' ./usr/lib/jvm/java-8-openjdk-armhf/jre/lib/security/java.security 37 | 38 | #=================== 39 | # Timezone settings 40 | # Possible alternative: https://github.com/docker/docker/issues/3359#issuecomment-32150214 41 | #=================== 42 | ENV TZ "UTC" 43 | RUN echo "${TZ}" > /etc/timezone \ 44 | && dpkg-reconfigure --frontend noninteractive tzdata 45 | 46 | #======================================== 47 | # Add normal user with passwordless sudo 48 | #======================================== 49 | RUN useradd seluser \ 50 | --shell /bin/bash \ 51 | --create-home \ 52 | && usermod -a -G sudo seluser \ 53 | && echo 'ALL ALL = (ALL) NOPASSWD: ALL' >> /etc/sudoers \ 54 | && echo 'seluser:secret' | chpasswd 55 | ENV HOME=/home/seluser 56 | 57 | #======================================= 58 | # Create shared / common bin directory 59 | #======================================= 60 | RUN mkdir -p /opt/bin 61 | 62 | #====================================== 63 | # Add Grid check script 64 | #====================================== 65 | COPY check-grid.sh entry_point.sh /opt/bin/ 66 | RUN chmod +x /opt/bin/check-grid.sh 67 | 68 | #====================================== 69 | # Add Supervisor configuration file 70 | #====================================== 71 | COPY supervisord.conf /etc 72 | 73 | #========== 74 | # Selenium & relaxing permissions for OpenShift and other non-sudo environments 75 | #========== 76 | RUN mkdir -p /opt/selenium /var/run/supervisor /var/log/supervisor \ 77 | && touch /opt/selenium/config.json \ 78 | && chmod -R 777 /opt/selenium /var/run/supervisor /var/log/supervisor /etc/passwd \ 79 | && wget --no-verbose https://selenium-release.storage.googleapis.com/3.141/selenium-server-standalone-3.141.59.jar \ 80 | -O /opt/selenium/selenium-server-standalone.jar \ 81 | && chgrp -R 0 /opt/selenium ${HOME} /var/run/supervisor /var/log/supervisor \ 82 | && chmod -R g=u /opt/selenium ${HOME} /var/run/supervisor /var/log/supervisor 83 | 84 | #RUN apt-get -qqy update \ 85 | # && apt-get -qqy --no-install-recommends install \ 86 | # qemu \ 87 | # qemu-user-static \ 88 | # binfmt-support \ 89 | # && cp /usr/bin/qemu-arm-static /usr/bin \ 90 | # && sh -c "sed -ie 's/^\([^#].*\)/# \1/g' /etc/ld.so.preload" \ 91 | # && update-binfmts --display \ 92 | # && rm -rf /var/lib/apt/lists/* /var/cache/apt/* 93 | #=================================================== 94 | # Run the following commands as non-privileged user 95 | #=================================================== 96 | USER seluser 97 | 98 | CMD ["/opt/bin/entry_point.sh"] 99 | -------------------------------------------------------------------------------- /NodeBase/Dockerfile.txt: -------------------------------------------------------------------------------- 1 | USER root 2 | 3 | #============== 4 | # Xvfb 5 | #============== 6 | RUN apt-get update -qqy \ 7 | && apt-get -qqy install \ 8 | xvfb \ 9 | && rm -rf /var/lib/apt/lists/* /var/cache/apt/* 10 | 11 | #============================== 12 | # Locale and encoding settings 13 | #============================== 14 | ENV LANG_WHICH en 15 | ENV LANG_WHERE US 16 | ENV ENCODING UTF-8 17 | ENV LANGUAGE ${LANG_WHICH}_${LANG_WHERE}.${ENCODING} 18 | ENV LANG ${LANGUAGE} 19 | # Layer size: small: ~9 MB 20 | # Layer size: small: ~9 MB MB (with --no-install-recommends) 21 | RUN apt-get -qqy update \ 22 | && apt-get -qqy --no-install-recommends install \ 23 | language-pack-en \ 24 | tzdata \ 25 | locales \ 26 | && locale-gen ${LANGUAGE} \ 27 | && dpkg-reconfigure --frontend noninteractive locales \ 28 | && apt-get -qyy autoremove \ 29 | && rm -rf /var/lib/apt/lists/* \ 30 | && apt-get -qyy clean 31 | 32 | #================ 33 | # Font libraries 34 | #================ 35 | # libfontconfig ~1 MB 36 | # libfreetype6 ~1 MB 37 | # xfonts-cyrillic ~2 MB 38 | # xfonts-scalable ~2 MB 39 | # fonts-liberation ~3 MB 40 | # fonts-ipafont-gothic ~13 MB 41 | # fonts-wqy-zenhei ~17 MB 42 | # fonts-tlwg-loma-otf ~300 KB 43 | # ttf-ubuntu-font-family ~5 MB 44 | # Ubuntu Font Family, sans-serif typeface hinted for clarity 45 | # Removed packages: 46 | # xfonts-100dpi ~6 MB 47 | # xfonts-75dpi ~6 MB 48 | # Regarding fonts-liberation see: 49 | # https://github.com/SeleniumHQ/docker-selenium/issues/383#issuecomment-278367069 50 | # Layer size: small: 36.28 MB (with --no-install-recommends) 51 | # Layer size: small: 36.28 MB 52 | RUN apt-get -qqy update \ 53 | && apt-get -qqy --no-install-recommends install \ 54 | libfontconfig \ 55 | libfreetype6 \ 56 | xfonts-cyrillic \ 57 | xfonts-scalable \ 58 | fonts-liberation \ 59 | fonts-ipafont-gothic \ 60 | fonts-wqy-zenhei \ 61 | fonts-tlwg-loma-otf \ 62 | ttf-ubuntu-font-family \ 63 | && rm -rf /var/lib/apt/lists/* \ 64 | && apt-get -qyy clean 65 | 66 | #=================================================== 67 | # Run the following commands as non-privileged user 68 | #=================================================== 69 | 70 | USER seluser 71 | 72 | #============================== 73 | # Scripts to run Selenium Node and XVFB 74 | #============================== 75 | COPY start-selenium-node.sh \ 76 | start-xvfb.sh \ 77 | /opt/bin/ 78 | 79 | #============================== 80 | # Supervisor configuration file 81 | #============================== 82 | COPY selenium.conf /etc/supervisor/conf.d/ 83 | 84 | 85 | #============================ 86 | # Some configuration options 87 | #============================ 88 | ENV SCREEN_WIDTH 1360 89 | ENV SCREEN_HEIGHT 1020 90 | ENV SCREEN_DEPTH 24 91 | ENV DISPLAY :99.0 92 | ENV START_XVFB true 93 | 94 | #======================== 95 | # Selenium Configuration 96 | #======================== 97 | # As integer, maps to "maxInstances" 98 | ENV NODE_MAX_INSTANCES 1 99 | # As integer, maps to "maxSession" 100 | ENV NODE_MAX_SESSION 1 101 | # As address, maps to "host" 102 | ENV NODE_HOST 0.0.0.0 103 | # As integer, maps to "port" 104 | ENV NODE_PORT 5555 105 | # In milliseconds, maps to "registerCycle" 106 | ENV NODE_REGISTER_CYCLE 5000 107 | # In milliseconds, maps to "nodePolling" 108 | ENV NODE_POLLING 5000 109 | # In milliseconds, maps to "unregisterIfStillDownAfter" 110 | ENV NODE_UNREGISTER_IF_STILL_DOWN_AFTER 60000 111 | # As integer, maps to "downPollingLimit" 112 | ENV NODE_DOWN_POLLING_LIMIT 2 113 | # As string, maps to "applicationName" 114 | ENV NODE_APPLICATION_NAME "" 115 | # Debug 116 | ENV GRID_DEBUG false 117 | 118 | # Following line fixes https://github.com/SeleniumHQ/docker-selenium/issues/87 119 | ENV DBUS_SESSION_BUS_ADDRESS=/dev/null 120 | 121 | # Creating base directory for Xvfb 122 | RUN sudo mkdir -p /tmp/.X11-unix && sudo chmod 1777 /tmp/.X11-unix 123 | -------------------------------------------------------------------------------- /NodeBase/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM kynetiv/selenium-base-pi:3.141.59-dubnium 2 | 3 | USER root 4 | 5 | #============== 6 | # Xvfb 7 | #============== 8 | RUN apt-get update -qqy \ 9 | && apt-get -qqy install \ 10 | xvfb \ 11 | && rm -rf /var/lib/apt/lists/* /var/cache/apt/* 12 | 13 | #============================== 14 | # Locale and encoding settings 15 | #============================== 16 | ENV LANG_WHICH en 17 | ENV LANG_WHERE US 18 | ENV ENCODING UTF-8 19 | ENV LANGUAGE ${LANG_WHICH}_${LANG_WHERE}.${ENCODING} 20 | ENV LANG ${LANGUAGE} 21 | # Layer size: small: ~9 MB 22 | # Layer size: small: ~9 MB MB (with --no-install-recommends) 23 | RUN apt-get -qqy update \ 24 | && apt-get -qqy --no-install-recommends install \ 25 | language-pack-en \ 26 | tzdata \ 27 | locales \ 28 | && locale-gen ${LANGUAGE} \ 29 | && dpkg-reconfigure --frontend noninteractive locales \ 30 | && apt-get -qyy autoremove \ 31 | && rm -rf /var/lib/apt/lists/* \ 32 | && apt-get -qyy clean 33 | 34 | #================ 35 | # Font libraries 36 | #================ 37 | # libfontconfig ~1 MB 38 | # libfreetype6 ~1 MB 39 | # xfonts-cyrillic ~2 MB 40 | # xfonts-scalable ~2 MB 41 | # fonts-liberation ~3 MB 42 | # fonts-ipafont-gothic ~13 MB 43 | # fonts-wqy-zenhei ~17 MB 44 | # fonts-tlwg-loma-otf ~300 KB 45 | # ttf-ubuntu-font-family ~5 MB 46 | # Ubuntu Font Family, sans-serif typeface hinted for clarity 47 | # Removed packages: 48 | # xfonts-100dpi ~6 MB 49 | # xfonts-75dpi ~6 MB 50 | # Regarding fonts-liberation see: 51 | # https://github.com/SeleniumHQ/docker-selenium/issues/383#issuecomment-278367069 52 | # Layer size: small: 36.28 MB (with --no-install-recommends) 53 | # Layer size: small: 36.28 MB 54 | RUN apt-get -qqy update \ 55 | && apt-get -qqy --no-install-recommends install \ 56 | libfontconfig \ 57 | libfreetype6 \ 58 | xfonts-cyrillic \ 59 | xfonts-scalable \ 60 | fonts-liberation \ 61 | fonts-ipafont-gothic \ 62 | fonts-wqy-zenhei \ 63 | fonts-tlwg-loma-otf \ 64 | ttf-ubuntu-font-family \ 65 | && rm -rf /var/lib/apt/lists/* \ 66 | && apt-get -qyy clean 67 | 68 | #=================================================== 69 | # Run the following commands as non-privileged user 70 | #=================================================== 71 | 72 | USER seluser 73 | 74 | #============================== 75 | # Scripts to run Selenium Node and XVFB 76 | #============================== 77 | COPY start-selenium-node.sh \ 78 | start-xvfb.sh \ 79 | /opt/bin/ 80 | 81 | #============================== 82 | # Supervisor configuration file 83 | #============================== 84 | COPY selenium.conf /etc/supervisor/conf.d/ 85 | 86 | 87 | #============================ 88 | # Some configuration options 89 | #============================ 90 | ENV SCREEN_WIDTH 1360 91 | ENV SCREEN_HEIGHT 1020 92 | ENV SCREEN_DEPTH 24 93 | ENV DISPLAY :99.0 94 | ENV START_XVFB true 95 | 96 | #======================== 97 | # Selenium Configuration 98 | #======================== 99 | # As integer, maps to "maxInstances" 100 | ENV NODE_MAX_INSTANCES 1 101 | # As integer, maps to "maxSession" 102 | ENV NODE_MAX_SESSION 1 103 | # As address, maps to "host" 104 | ENV NODE_HOST 0.0.0.0 105 | # As integer, maps to "port" 106 | ENV NODE_PORT 5555 107 | # In milliseconds, maps to "registerCycle" 108 | ENV NODE_REGISTER_CYCLE 5000 109 | # In milliseconds, maps to "nodePolling" 110 | ENV NODE_POLLING 5000 111 | # In milliseconds, maps to "unregisterIfStillDownAfter" 112 | ENV NODE_UNREGISTER_IF_STILL_DOWN_AFTER 60000 113 | # As integer, maps to "downPollingLimit" 114 | ENV NODE_DOWN_POLLING_LIMIT 2 115 | # As string, maps to "applicationName" 116 | ENV NODE_APPLICATION_NAME "" 117 | # Debug 118 | ENV GRID_DEBUG false 119 | 120 | # Following line fixes https://github.com/SeleniumHQ/docker-selenium/issues/87 121 | ENV DBUS_SESSION_BUS_ADDRESS=/dev/null 122 | 123 | # Creating base directory for Xvfb 124 | RUN sudo mkdir -p /tmp/.X11-unix && sudo chmod 1777 /tmp/.X11-unix 125 | -------------------------------------------------------------------------------- /LICENSE.txt: -------------------------------------------------------------------------------- 1 | Apache License 2 | Version 2.0, January 2004 3 | http://www.apache.org/licenses/ 4 | 5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 6 | 7 | 1. Definitions. 8 | 9 | "License" shall mean the terms and conditions for use, reproduction, 10 | and distribution as defined by Sections 1 through 9 of this document. 11 | 12 | "Licensor" shall mean the copyright owner or entity authorized by 13 | the copyright owner that is granting the License. 14 | 15 | "Legal Entity" shall mean the union of the acting entity and all 16 | other entities that control, are controlled by, or are under common 17 | control with that entity. For the purposes of this definition, 18 | "control" means (i) the power, direct or indirect, to cause the 19 | direction or management of such entity, whether by contract or 20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 21 | outstanding shares, or (iii) beneficial ownership of such entity. 22 | 23 | "You" (or "Your") shall mean an individual or Legal Entity 24 | exercising permissions granted by this License. 25 | 26 | "Source" form shall mean the preferred form for making modifications, 27 | including but not limited to software source code, documentation 28 | source, and configuration files. 29 | 30 | "Object" form shall mean any form resulting from mechanical 31 | transformation or translation of a Source form, including but 32 | not limited to compiled object code, generated documentation, 33 | and conversions to other media types. 34 | 35 | "Work" shall mean the work of authorship, whether in Source or 36 | Object form, made available under the License, as indicated by a 37 | copyright notice that is included in or attached to the work 38 | (an example is provided in the Appendix below). 39 | 40 | "Derivative Works" shall mean any work, whether in Source or Object 41 | form, that is based on (or derived from) the Work and for which the 42 | editorial revisions, annotations, elaborations, or other modifications 43 | represent, as a whole, an original work of authorship. For the purposes 44 | of this License, Derivative Works shall not include works that remain 45 | separable from, or merely link (or bind by name) to the interfaces of, 46 | the Work and Derivative Works thereof. 47 | 48 | "Contribution" shall mean any work of authorship, including 49 | the original version of the Work and any modifications or additions 50 | to that Work or Derivative Works thereof, that is intentionally 51 | submitted to Licensor for inclusion in the Work by the copyright owner 52 | or by an individual or Legal Entity authorized to submit on behalf of 53 | the copyright owner. For the purposes of this definition, "submitted" 54 | means any form of electronic, verbal, or written communication sent 55 | to the Licensor or its representatives, including but not limited to 56 | communication on electronic mailing lists, source code control systems, 57 | and issue tracking systems that are managed by, or on behalf of, the 58 | Licensor for the purpose of discussing and improving the Work, but 59 | excluding communication that is conspicuously marked or otherwise 60 | designated in writing by the copyright owner as "Not a Contribution." 61 | 62 | "Contributor" shall mean Licensor and any individual or Legal Entity 63 | on behalf of whom a Contribution has been received by Licensor and 64 | subsequently incorporated within the Work. 65 | 66 | 2. Grant of Copyright License. Subject to the terms and conditions of 67 | this License, each Contributor hereby grants to You a perpetual, 68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 69 | copyright license to reproduce, prepare Derivative Works of, 70 | publicly display, publicly perform, sublicense, and distribute the 71 | Work and such Derivative Works in Source or Object form. 72 | 73 | 3. Grant of Patent License. Subject to the terms and conditions of 74 | this License, each Contributor hereby grants to You a perpetual, 75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 76 | (except as stated in this section) patent license to make, have made, 77 | use, offer to sell, sell, import, and otherwise transfer the Work, 78 | where such license applies only to those patent claims licensable 79 | by such Contributor that are necessarily infringed by their 80 | Contribution(s) alone or by combination of their Contribution(s) 81 | with the Work to which such Contribution(s) was submitted. If You 82 | institute patent litigation against any entity (including a 83 | cross-claim or counterclaim in a lawsuit) alleging that the Work 84 | or a Contribution incorporated within the Work constitutes direct 85 | or contributory patent infringement, then any patent licenses 86 | granted to You under this License for that Work shall terminate 87 | as of the date such litigation is filed. 88 | 89 | 4. Redistribution. You may reproduce and distribute copies of the 90 | Work or Derivative Works thereof in any medium, with or without 91 | modifications, and in Source or Object form, provided that You 92 | meet the following conditions: 93 | 94 | (a) You must give any other recipients of the Work or 95 | Derivative Works a copy of this License; and 96 | 97 | (b) You must cause any modified files to carry prominent notices 98 | stating that You changed the files; and 99 | 100 | (c) You must retain, in the Source form of any Derivative Works 101 | that You distribute, all copyright, patent, trademark, and 102 | attribution notices from the Source form of the Work, 103 | excluding those notices that do not pertain to any part of 104 | the Derivative Works; and 105 | 106 | (d) If the Work includes a "NOTICE" text file as part of its 107 | distribution, then any Derivative Works that You distribute must 108 | include a readable copy of the attribution notices contained 109 | within such NOTICE file, excluding those notices that do not 110 | pertain to any part of the Derivative Works, in at least one 111 | of the following places: within a NOTICE text file distributed 112 | as part of the Derivative Works; within the Source form or 113 | documentation, if provided along with the Derivative Works; or, 114 | within a display generated by the Derivative Works, if and 115 | wherever such third-party notices normally appear. The contents 116 | of the NOTICE file are for informational purposes only and 117 | do not modify the License. You may add Your own attribution 118 | notices within Derivative Works that You distribute, alongside 119 | or as an addendum to the NOTICE text from the Work, provided 120 | that such additional attribution notices cannot be construed 121 | as modifying the License. 122 | 123 | You may add Your own copyright statement to Your modifications and 124 | may provide additional or different license terms and conditions 125 | for use, reproduction, or distribution of Your modifications, or 126 | for any such Derivative Works as a whole, provided Your use, 127 | reproduction, and distribution of the Work otherwise complies with 128 | the conditions stated in this License. 129 | 130 | 5. Submission of Contributions. Unless You explicitly state otherwise, 131 | any Contribution intentionally submitted for inclusion in the Work 132 | by You to the Licensor shall be under the terms and conditions of 133 | this License, without any additional terms or conditions. 134 | Notwithstanding the above, nothing herein shall supersede or modify 135 | the terms of any separate license agreement you may have executed 136 | with Licensor regarding such Contributions. 137 | 138 | 6. Trademarks. This License does not grant permission to use the trade 139 | names, trademarks, service marks, or product names of the Licensor, 140 | except as required for reasonable and customary use in describing the 141 | origin of the Work and reproducing the content of the NOTICE file. 142 | 143 | 7. Disclaimer of Warranty. Unless required by applicable law or 144 | agreed to in writing, Licensor provides the Work (and each 145 | Contributor provides its Contributions) on an "AS IS" BASIS, 146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 147 | implied, including, without limitation, any warranties or conditions 148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 149 | PARTICULAR PURPOSE. You are solely responsible for determining the 150 | appropriateness of using or redistributing the Work and assume any 151 | risks associated with Your exercise of permissions under this License. 152 | 153 | 8. Limitation of Liability. In no event and under no legal theory, 154 | whether in tort (including negligence), contract, or otherwise, 155 | unless required by applicable law (such as deliberate and grossly 156 | negligent acts) or agreed to in writing, shall any Contributor be 157 | liable to You for damages, including any direct, indirect, special, 158 | incidental, or consequential damages of any character arising as a 159 | result of this License or out of the use or inability to use the 160 | Work (including but not limited to damages for loss of goodwill, 161 | work stoppage, computer failure or malfunction, or any and all 162 | other commercial damages or losses), even if such Contributor 163 | has been advised of the possibility of such damages. 164 | 165 | 9. Accepting Warranty or Additional Liability. While redistributing 166 | the Work or Derivative Works thereof, You may choose to offer, 167 | and charge a fee for, acceptance of support, warranty, indemnity, 168 | or other liability obligations and/or rights consistent with this 169 | License. However, in accepting such obligations, You may act only 170 | on Your own behalf and on Your sole responsibility, not on behalf 171 | of any other Contributor, and only if You agree to indemnify, 172 | defend, and hold each Contributor harmless for any liability 173 | incurred by, or claims asserted against, such Contributor by reason 174 | of your accepting any such warranty or additional liability. 175 | 176 | END OF TERMS AND CONDITIONS 177 | 178 | APPENDIX: How to apply the Apache License to your work. 179 | 180 | To apply the Apache License to your work, attach the following 181 | boilerplate notice, with the fields enclosed by brackets "{}" 182 | replaced with your own identifying information. (Don't include 183 | the brackets!) The text should be enclosed in the appropriate 184 | comment syntax for the file format. We also recommend that a 185 | file or class name and description of purpose be included on the 186 | same "printed page" as the copyright notice for easier 187 | identification within third-party archives. 188 | 189 | Copyright {yyyy} {name of copyright owner} 190 | 191 | Licensed under the Apache License, Version 2.0 (the "License"); 192 | you may not use this file except in compliance with the License. 193 | You may obtain a copy of the License at 194 | 195 | http://www.apache.org/licenses/LICENSE-2.0 196 | 197 | Unless required by applicable law or agreed to in writing, software 198 | distributed under the License is distributed on an "AS IS" BASIS, 199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 200 | See the License for the specific language governing permissions and 201 | limitations under the License. 202 | --------------------------------------------------------------------------------