diff --git a/.gitignore b/.gitignore index 64d2d22ee..7377b135b 100644 --- a/.gitignore +++ b/.gitignore @@ -147,4 +147,4 @@ ENV/ # End of https://www.gitignore.io/api/python .DS_Store -release_sandbox + diff --git a/Distributor/Dockerfile b/Distributor/Dockerfile index 91a3c9cc3..75e75468a 100644 --- a/Distributor/Dockerfile +++ b/Distributor/Dockerfile @@ -1,9 +1,8 @@ -# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -# NOTE: DO *NOT* EDIT THIS FILE. IT IS GENERATED. -# PLEASE UPDATE Dockerfile.txt INSTEAD OF THIS FILE -# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -FROM selenium/base:4.4.0-20220812 -LABEL authors=SeleniumHQ +ARG NAMESPACE +ARG VERSION +ARG AUTHORS +FROM ${NAMESPACE}/base:${VERSION} +LABEL authors=${AUTHORS} USER 1200 diff --git a/Distributor/Dockerfile.txt b/Distributor/Dockerfile.txt deleted file mode 100644 index 7ef2f4ea5..000000000 --- a/Distributor/Dockerfile.txt +++ /dev/null @@ -1,12 +0,0 @@ -USER 1200 - -#======================== -# Selenium Distributor Configuration -#======================== - -EXPOSE 5553 - -COPY start-selenium-grid-distributor.sh \ - /opt/bin/ - -COPY selenium-grid-distributor.conf /etc/supervisor/conf.d/ diff --git a/Distributor/generate.sh b/Distributor/generate.sh deleted file mode 100755 index fdbf1a7b2..000000000 --- a/Distributor/generate.sh +++ /dev/null @@ -1,14 +0,0 @@ -#!/usr/bin/env 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 ${NAMESPACE}/base:${VERSION} >> ./Dockerfile -echo LABEL authors="$AUTHORS" >> ./Dockerfile -echo "" >> ./Dockerfile -cat ./Dockerfile.txt >> ./Dockerfile diff --git a/EventBus/Dockerfile b/EventBus/Dockerfile index b3f0df85f..16985e7b2 100644 --- a/EventBus/Dockerfile +++ b/EventBus/Dockerfile @@ -1,9 +1,8 @@ -# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -# NOTE: DO *NOT* EDIT THIS FILE. IT IS GENERATED. -# PLEASE UPDATE Dockerfile.txt INSTEAD OF THIS FILE -# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -FROM selenium/base:4.4.0-20220812 -LABEL authors=SeleniumHQ +ARG NAMESPACE +ARG VERSION +ARG AUTHORS +FROM ${NAMESPACE}/base:${VERSION} +LABEL authors=${AUTHORS} USER 1200 diff --git a/EventBus/Dockerfile.txt b/EventBus/Dockerfile.txt deleted file mode 100644 index 0e062d37f..000000000 --- a/EventBus/Dockerfile.txt +++ /dev/null @@ -1,17 +0,0 @@ -USER 1200 - -#================================= -# Selenium Event Bus Configuration -#================================= - -# Port where events are published -EXPOSE 4442 -# Port where to subscribe for events -EXPOSE 4443 -# Event Bus port -EXPOSE 5557 - -COPY start-selenium-grid-eventbus.sh \ - /opt/bin/ - -COPY selenium-grid-eventbus.conf /etc/supervisor/conf.d/ diff --git a/EventBus/generate.sh b/EventBus/generate.sh deleted file mode 100755 index fdbf1a7b2..000000000 --- a/EventBus/generate.sh +++ /dev/null @@ -1,14 +0,0 @@ -#!/usr/bin/env 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 ${NAMESPACE}/base:${VERSION} >> ./Dockerfile -echo LABEL authors="$AUTHORS" >> ./Dockerfile -echo "" >> ./Dockerfile -cat ./Dockerfile.txt >> ./Dockerfile diff --git a/Hub/Dockerfile b/Hub/Dockerfile index ffaf26a10..56348d8ba 100644 --- a/Hub/Dockerfile +++ b/Hub/Dockerfile @@ -1,9 +1,8 @@ -# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -# NOTE: DO *NOT* EDIT THIS FILE. IT IS GENERATED. -# PLEASE UPDATE Dockerfile.txt INSTEAD OF THIS FILE -# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -FROM selenium/base:4.4.0-20220812 -LABEL authors=SeleniumHQ +ARG NAMESPACE +ARG VERSION +ARG AUTHORS +FROM ${NAMESPACE}/base:${VERSION} +LABEL authors=${AUTHORS} USER 1200 diff --git a/Hub/Dockerfile.txt b/Hub/Dockerfile.txt deleted file mode 100644 index c02e1a354..000000000 --- a/Hub/Dockerfile.txt +++ /dev/null @@ -1,21 +0,0 @@ -USER 1200 - -#======================== -# Selenium Hub Configuration -#======================== - -EXPOSE 4442 -EXPOSE 4443 -EXPOSE 4444 - -# In seconds, maps to "--session-request-timeout" -ENV SE_SESSION_REQUEST_TIMEOUT 300 -# In seconds, maps to "--session-retry-interval" -ENV SE_SESSION_RETRY_INTERVAL 15 -# Boolean value, maps "--relax-checks" -ENV SE_RELAX_CHECKS true - -COPY start-selenium-grid-hub.sh \ - /opt/bin/ - -COPY selenium-grid-hub.conf /etc/supervisor/conf.d/ diff --git a/Hub/generate.sh b/Hub/generate.sh deleted file mode 100755 index fdbf1a7b2..000000000 --- a/Hub/generate.sh +++ /dev/null @@ -1,14 +0,0 @@ -#!/usr/bin/env 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 ${NAMESPACE}/base:${VERSION} >> ./Dockerfile -echo LABEL authors="$AUTHORS" >> ./Dockerfile -echo "" >> ./Dockerfile -cat ./Dockerfile.txt >> ./Dockerfile diff --git a/Makefile b/Makefile index 9e6bd4e50..797350633 100644 --- a/Makefile +++ b/Makefile @@ -6,6 +6,7 @@ TAG_VERSION := $(VERSION)-$(BUILD_DATE) NAMESPACE := $(or $(NAMESPACE),$(NAMESPACE),$(NAME)) AUTHORS := $(or $(AUTHORS),$(AUTHORS),SeleniumHQ) PUSH_IMAGE := $(or $(PUSH_IMAGE),$(PUSH_IMAGE),false) +FROM_IMAGE_ARGS := --build-arg NAMESPACE=$(NAMESPACE) --build-arg VERSION=$(TAG_VERSION) --build-arg AUTHORS=$(AUTHORS) BUILD_ARGS := $(BUILD_ARGS) MAJOR := $(word 1,$(subst ., ,$(TAG_VERSION))) MINOR := $(word 2,$(subst ., ,$(TAG_VERSION))) @@ -29,22 +30,6 @@ all: hub \ standalone_docker \ video -generate_all: \ - generate_hub \ - generate_distributor \ - generate_router \ - generate_sessions \ - generate_sessionqueue \ - generate_event_bus \ - generate_node_base \ - generate_chrome \ - generate_edge \ - generate_firefox \ - generate_docker \ - generate_standalone_firefox \ - generate_standalone_chrome \ - generate_standalone_edge \ - generate_standalone_docker build: all @@ -53,95 +38,50 @@ ci: build test base: cd ./Base && docker build $(BUILD_ARGS) -t $(NAME)/base:$(TAG_VERSION) . -generate_hub: - cd ./Hub && ./generate.sh $(TAG_VERSION) $(NAMESPACE) $(AUTHORS) +hub: base + cd ./Hub && docker build $(BUILD_ARGS) $(FROM_IMAGE_ARGS) -t $(NAME)/hub:$(TAG_VERSION) . -hub: base generate_hub - cd ./Hub && docker build $(BUILD_ARGS) -t $(NAME)/hub:$(TAG_VERSION) . +distributor: base + cd ./Distributor && docker build $(BUILD_ARGS) $(FROM_IMAGE_ARGS) -t $(NAME)/distributor:$(TAG_VERSION) . -generate_distributor: - cd ./Distributor && ./generate.sh $(TAG_VERSION) $(NAMESPACE) $(AUTHORS) +router: base + cd ./Router && docker build $(BUILD_ARGS) $(FROM_IMAGE_ARGS) -t $(NAME)/router:$(TAG_VERSION) . -distributor: base generate_distributor - cd ./Distributor && docker build $(BUILD_ARGS) -t $(NAME)/distributor:$(TAG_VERSION) . +sessions: base + cd ./Sessions && docker build $(BUILD_ARGS) $(FROM_IMAGE_ARGS) -t $(NAME)/sessions:$(TAG_VERSION) . -generate_router: - cd ./Router && ./generate.sh $(TAG_VERSION) $(NAMESPACE) $(AUTHORS) +sessionqueue: base + cd ./SessionQueue && docker build $(BUILD_ARGS) $(FROM_IMAGE_ARGS) -t $(NAME)/session-queue:$(TAG_VERSION) . -router: base generate_router - cd ./Router && docker build $(BUILD_ARGS) -t $(NAME)/router:$(TAG_VERSION) . +event_bus: base + cd ./EventBus && docker build $(BUILD_ARGS) $(FROM_IMAGE_ARGS) -t $(NAME)/event-bus:$(TAG_VERSION) . -generate_sessions: - cd ./Sessions && ./generate.sh $(TAG_VERSION) $(NAMESPACE) $(AUTHORS) +node_base: base + cd ./NodeBase && docker build $(BUILD_ARGS) $(FROM_IMAGE_ARGS) -t $(NAME)/node-base:$(TAG_VERSION) . -sessions: base generate_sessions - cd ./Sessions && docker build $(BUILD_ARGS) -t $(NAME)/sessions:$(TAG_VERSION) . +chrome: node_base + cd ./NodeChrome && docker build $(BUILD_ARGS) $(FROM_IMAGE_ARGS) -t $(NAME)/node-chrome:$(TAG_VERSION) . -generate_sessionqueue: - cd ./SessionQueue && ./generate.sh $(TAG_VERSION) $(NAMESPACE) $(AUTHORS) +edge: node_base + cd ./NodeEdge && docker build $(BUILD_ARGS) $(FROM_IMAGE_ARGS) -t $(NAME)/node-edge:$(TAG_VERSION) . -sessionqueue: base generate_sessionqueue - cd ./SessionQueue && docker build $(BUILD_ARGS) -t $(NAME)/session-queue:$(TAG_VERSION) . +firefox: node_base + cd ./NodeFirefox && docker build $(BUILD_ARGS) $(FROM_IMAGE_ARGS) -t $(NAME)/node-firefox:$(TAG_VERSION) . -generate_event_bus: - cd ./EventBus && ./generate.sh $(TAG_VERSION) $(NAMESPACE) $(AUTHORS) +docker: base + cd ./NodeDocker && docker build $(BUILD_ARGS) $(FROM_IMAGE_ARGS) -t $(NAME)/node-docker:$(TAG_VERSION) . -event_bus: base generate_event_bus - cd ./EventBus && docker build $(BUILD_ARGS) -t $(NAME)/event-bus:$(TAG_VERSION) . +standalone_docker: docker + cd ./StandaloneDocker && docker build $(BUILD_ARGS) $(FROM_IMAGE_ARGS) -t $(NAME)/standalone-docker:$(TAG_VERSION) . -generate_node_base: - cd ./NodeBase && ./generate.sh $(TAG_VERSION) $(NAMESPACE) $(AUTHORS) +standalone_firefox: firefox + cd ./Standalone && docker build $(BUILD_ARGS) $(FROM_IMAGE_ARGS) --build-arg BASE=node-firefox -t $(NAME)/standalone-firefox:$(TAG_VERSION) . -node_base: base generate_node_base - cd ./NodeBase && docker build $(BUILD_ARGS) -t $(NAME)/node-base:$(TAG_VERSION) . +standalone_chrome: chrome + cd ./Standalone && docker build $(BUILD_ARGS) $(FROM_IMAGE_ARGS) --build-arg BASE=node-chrome -t $(NAME)/standalone-chrome:$(TAG_VERSION) . -generate_chrome: - cd ./NodeChrome && ./generate.sh $(TAG_VERSION) $(NAMESPACE) $(AUTHORS) - -chrome: node_base generate_chrome - cd ./NodeChrome && docker build $(BUILD_ARGS) -t $(NAME)/node-chrome:$(TAG_VERSION) . - -generate_edge: - cd ./NodeEdge && ./generate.sh $(TAG_VERSION) $(NAMESPACE) $(AUTHORS) - -edge: node_base generate_edge - cd ./NodeEdge && docker build $(BUILD_ARGS) -t $(NAME)/node-edge:$(TAG_VERSION) . - -generate_firefox: - cd ./NodeFirefox && ./generate.sh $(TAG_VERSION) $(NAMESPACE) $(AUTHORS) - -firefox: node_base generate_firefox - cd ./NodeFirefox && docker build $(BUILD_ARGS) -t $(NAME)/node-firefox:$(TAG_VERSION) . - -generate_docker: - cd ./NodeDocker && ./generate.sh $(TAG_VERSION) $(NAMESPACE) $(AUTHORS) - -docker: base generate_docker - cd ./NodeDocker && docker build $(BUILD_ARGS) -t $(NAME)/node-docker:$(TAG_VERSION) . - -generate_standalone_docker: - cd ./StandaloneDocker && ./generate.sh $(TAG_VERSION) $(NAMESPACE) $(AUTHORS) - -standalone_docker: docker generate_standalone_docker - cd ./StandaloneDocker && docker build $(BUILD_ARGS) -t $(NAME)/standalone-docker:$(TAG_VERSION) . - -generate_standalone_firefox: - cd ./Standalone && ./generate.sh StandaloneFirefox node-firefox $(TAG_VERSION) $(NAMESPACE) $(AUTHORS) - -standalone_firefox: firefox generate_standalone_firefox - cd ./StandaloneFirefox && docker build $(BUILD_ARGS) -t $(NAME)/standalone-firefox:$(TAG_VERSION) . - -generate_standalone_chrome: - cd ./Standalone && ./generate.sh StandaloneChrome node-chrome $(TAG_VERSION) $(NAMESPACE) $(AUTHORS) - -standalone_chrome: chrome generate_standalone_chrome - cd ./StandaloneChrome && docker build $(BUILD_ARGS) -t $(NAME)/standalone-chrome:$(TAG_VERSION) . - -generate_standalone_edge: - cd ./Standalone && ./generate.sh StandaloneEdge node-edge $(TAG_VERSION) $(NAMESPACE) $(AUTHORS) - -standalone_edge: edge generate_standalone_edge - cd ./StandaloneEdge && docker build $(BUILD_ARGS) -t $(NAME)/standalone-edge:$(TAG_VERSION) . +standalone_edge: edge + cd ./Standalone && docker build $(BUILD_ARGS) $(FROM_IMAGE_ARGS) --build-arg BASE=node-edge -t $(NAME)/standalone-edge:$(TAG_VERSION) . video: cd ./Video && docker build $(BUILD_ARGS) -t $(NAME)/video:$(FFMPEG_TAG_VERSION)-$(BUILD_DATE) . @@ -162,14 +102,6 @@ all_multi: base_multi \ standalone_chromium_multi \ standalone_firefox_multi -generate_all_multi: \ - generate_hub \ - generate_node_base \ - generate_chromium_multi \ - generate_firefox_multi \ - generate_standalone_chromium_multi \ - generate_standalone_firefox_multi - build_multi: all_multi ci_multi: build_multi test_multi_arch @@ -177,36 +109,23 @@ ci_multi: build_multi test_multi_arch base_multi: qemu_user_static cd ./Base && docker buildx build --platform $(PLATFORMS) $(BUILD_ARGS) -t $(NAME)/base:$(TAG_VERSION) . -hub_multi: base_multi generate_hub - cd ./Hub && docker buildx build --platform $(PLATFORMS) $(BUILD_ARGS) -t $(NAME)/hub:$(TAG_VERSION) . - -node_base_multi: base_multi generate_node_base - cd ./NodeBase && docker buildx build --platform $(PLATFORMS) $(BUILD_ARGS) -t $(NAME)/node-base:$(TAG_VERSION) . - -generate_chromium_multi: - cd ./NodeChromium && ./generate.sh $(TAG_VERSION) $(NAMESPACE) $(AUTHORS) - -chromium_multi: node_base_multi generate_chromium_multi - cd ./NodeChromium && docker buildx build --platform $(PLATFORMS) $(BUILD_ARGS) -t $(NAME)/node-chromium:$(TAG_VERSION) . - -# TODO: Need to make sure arguments are passed into the script to override defaults. -generate_firefox_multi: - cd ./NodeFirefox && ./generate-arm.sh $(TAG_VERSION) $(NAMESPACE) $(AUTHORS) +hub_multi: base_multi + cd ./Hub && docker buildx build --platform $(PLATFORMS) $(BUILD_ARGS) $(FROM_IMAGE_ARGS) -t $(NAME)/hub:$(TAG_VERSION) . -firefox_multi: node_base_multi generate_firefox_multi - cd ./NodeFirefox && docker buildx build --platform $(PLATFORMS) $(BUILD_ARGS) -t $(NAME)/node-firefox:$(TAG_VERSION) . +node_base_multi: base_multi + cd ./NodeBase && docker buildx build --platform $(PLATFORMS) $(BUILD_ARGS) $(FROM_IMAGE_ARGS) -t $(NAME)/node-base:$(TAG_VERSION) . -generate_standalone_firefox_multi: - cd ./Standalone && ./generate.sh StandaloneFirefox node-firefox $(TAG_VERSION) $(NAMESPACE) $(AUTHORS) +chromium_multi: node_base_multi + cd ./NodeChromium && docker buildx build --platform $(PLATFORMS) $(BUILD_ARGS) $(FROM_IMAGE_ARGS) -t $(NAME)/node-chromium:$(TAG_VERSION) . -standalone_firefox_multi: firefox_multi generate_standalone_firefox_multi - cd ./StandaloneFirefox && docker buildx build --platform $(PLATFORMS) $(BUILD_ARGS) -t $(NAME)/standalone-firefox:$(TAG_VERSION) . +firefox_multi: node_base_multi + cd ./NodeFirefox && docker buildx build -f Dockerfile.arm64 --platform $(PLATFORMS) $(BUILD_ARGS) $(FROM_IMAGE_ARGS) -t $(NAME)/node-firefox:$(TAG_VERSION) . -generate_standalone_chromium_multi: - cd ./Standalone && ./generate.sh StandaloneChromium node-chromium $(TAG_VERSION) $(NAMESPACE) $(AUTHORS) +standalone_firefox_multi: firefox_multi + cd ./Standalone && docker buildx build --platform $(PLATFORMS) $(BUILD_ARGS) $(FROM_IMAGE_ARGS) --build-arg BASE=node-firefox -t $(NAME)/standalone-firefox:$(TAG_VERSION) . -standalone_chromium_multi: chromium_multi generate_standalone_chromium_multi - cd ./StandaloneChromium && docker buildx build --platform $(PLATFORMS) $(BUILD_ARGS) -t $(NAME)/standalone-chromium:$(TAG_VERSION) . +standalone_chromium_multi: chromium_multi + cd ./Standalone && docker buildx build --platform $(PLATFORMS) $(BUILD_ARGS) $(FROM_IMAGE_ARGS) --build-arg BASE=node-chromium -t $(NAME)/standalone-chromium:$(TAG_VERSION) . # https://github.com/SeleniumHQ/docker-selenium/issues/992 # Additional tags for browser images @@ -495,22 +414,6 @@ test_video: video hub chrome firefox edge edge \ firefox \ docker \ - generate_all \ - generate_hub \ - generate_distributor \ - generate_router \ - generate_sessions \ - generate_sessionqueue \ - generate_event_bus \ - generate_node_base \ - generate_chrome \ - generate_edge \ - generate_firefox \ - generate_docker \ - generate_standalone_chrome \ - generate_standalone_edge \ - generate_standalone_firefox \ - generate_standalone_docker \ hub \ distributor \ router \ diff --git a/NodeBase/Dockerfile b/NodeBase/Dockerfile index 4f105dd20..cc5804bd6 100644 --- a/NodeBase/Dockerfile +++ b/NodeBase/Dockerfile @@ -1,9 +1,8 @@ -# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -# NOTE: DO *NOT* EDIT THIS FILE. IT IS GENERATED. -# PLEASE UPDATE Dockerfile.txt INSTEAD OF THIS FILE -# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -FROM selenium/base:4.4.0-20220812 -LABEL authors=SeleniumHQ +ARG NAMESPACE +ARG VERSION +ARG AUTHORS +FROM ${NAMESPACE}/base:${VERSION} +LABEL authors=${AUTHORS} USER root diff --git a/NodeBase/Dockerfile.txt b/NodeBase/Dockerfile.txt deleted file mode 100644 index ac38a9e29..000000000 --- a/NodeBase/Dockerfile.txt +++ /dev/null @@ -1,213 +0,0 @@ -USER root - -#============== -# Xvfb -#============== -RUN apt-get update -qqy \ - && apt-get -qqy install \ - xvfb \ - pulseaudio \ - && rm -rf /var/lib/apt/lists/* /var/cache/apt/* - -#============================== -# Locale and encoding settings -#============================== -ENV LANG_WHICH en -ENV LANG_WHERE US -ENV ENCODING UTF-8 -ENV LANGUAGE ${LANG_WHICH}_${LANG_WHERE}.${ENCODING} -ENV LANG ${LANGUAGE} -# Layer size: small: ~9 MB -# Layer size: small: ~9 MB MB (with --no-install-recommends) -RUN apt-get -qqy update \ - && apt-get -qqy --no-install-recommends install \ - #language-pack-en \ - tzdata \ - locales \ - && locale-gen ${LANGUAGE} \ - && dpkg-reconfigure --frontend noninteractive locales \ - && apt-get -qyy autoremove \ - && rm -rf /var/lib/apt/lists/* \ - && apt-get -qyy clean - -#===== -# VNC -#===== -RUN apt-get update -qqy \ - && apt-get -qqy install \ - x11vnc \ - && rm -rf /var/lib/apt/lists/* /var/cache/apt/* - -#========= -# fluxbox -# A fast, lightweight and responsive window manager -#========= -RUN apt-get update -qqy \ - && apt-get -qqy install \ - fluxbox \ - && rm -rf /var/lib/apt/lists/* /var/cache/apt/* - -#================ -# Font libraries -#================ -# libfontconfig ~1 MB -# libfreetype6 ~1 MB -# xfonts-cyrillic ~2 MB -# xfonts-scalable ~2 MB -# fonts-liberation ~3 MB -# fonts-ipafont-gothic ~13 MB -# fonts-wqy-zenhei ~17 MB -# fonts-tlwg-loma-otf ~300 KB -# ttf-ubuntu-font-family ~5 MB -# Ubuntu Font Family, sans-serif typeface hinted for clarity -# Removed packages: -# xfonts-100dpi ~6 MB -# xfonts-75dpi ~6 MB -# fonts-noto-color-emoji ~10 MB -# Regarding fonts-liberation see: -# https://github.com/SeleniumHQ/docker-selenium/issues/383#issuecomment-278367069 -# Layer size: small: 50.3 MB (with --no-install-recommends) -# Layer size: small: 50.3 MB -RUN apt-get -qqy update \ - && apt-get -qqy --no-install-recommends install \ - libfontconfig \ - libfreetype6 \ - xfonts-cyrillic \ - xfonts-scalable \ - fonts-liberation \ - fonts-ipafont-gothic \ - fonts-wqy-zenhei \ - fonts-tlwg-loma-otf \ - # ttf-ubuntu-font-family \ - fonts-noto-color-emoji \ - && rm -rf /var/lib/apt/lists/* \ - && apt-get -qyy clean - -######################################## -# noVNC exposes VNC through a web page # -######################################## -# Download https://github.com/novnc/noVNC dated 2021-03-30 commit 84f102d6a9ffaf3972693d59bad5c6fddb6d7fb0 -# Download https://github.com/novnc/websockify dated 2021-03-22 commit c5d365dd1dbfee89881f1c1c02a2ac64838d645f -ENV NOVNC_SHA="84f102d6a9ffaf3972693d59bad5c6fddb6d7fb0" \ - WEBSOCKIFY_SHA="c5d365dd1dbfee89881f1c1c02a2ac64838d645f" -RUN wget -nv -O noVNC.zip \ - "https://github.com/novnc/noVNC/archive/${NOVNC_SHA}.zip" \ - && unzip -x noVNC.zip \ - && mv noVNC-${NOVNC_SHA} /opt/bin/noVNC \ - && cp /opt/bin/noVNC/vnc.html /opt/bin/noVNC/index.html \ - && rm noVNC.zip \ - && wget -nv -O websockify.zip \ - "https://github.com/novnc/websockify/archive/${WEBSOCKIFY_SHA}.zip" \ - && unzip -x websockify.zip \ - && rm websockify.zip \ - && rm -rf websockify-${WEBSOCKIFY_SHA}/tests \ - && mv websockify-${WEBSOCKIFY_SHA} /opt/bin/noVNC/utils/websockify - -#========================================================================================================================================= -# Run this command for executable file permissions for /dev/shm when this is a "child" container running in Docker Desktop and WSL2 distro -#========================================================================================================================================= -RUN chmod +x /dev/shm - -#=================================================== -# Run the following commands as non-privileged user -#=================================================== - -USER 1200 - -#============================== -# Scripts to run Selenium Node and XVFB -#============================== -COPY start-selenium-node.sh \ - start-xvfb.sh \ - /opt/bin/ - -#============================== -# Supervisor configuration file -#============================== -COPY selenium.conf /etc/supervisor/conf.d/ - -#============================== -# Generating the VNC password as seluser -# So the service can be started with seluser -#============================== - -RUN mkdir -p ${HOME}/.vnc \ - && x11vnc -storepasswd secret ${HOME}/.vnc/passwd - -# Added to avoid the following sudo error while running multi-arch builds: -# "sudo: effective uid is not 0, is /usr/bin/sudo on a file system with -# the 'nosuid' option set or an NFS file system without root privileges?" -USER root - -#========== -# Relaxing permissions for OpenShift and other non-sudo environments -#========== -RUN chmod -R 777 ${HOME} \ - && chgrp -R 0 ${HOME} \ - && chmod -R g=u ${HOME} - -# Added to avoid sudo-related multi-arch build errors -USER 1200 - -#============================== -# Scripts to run fluxbox, x11vnc and noVNC -#============================== -COPY start-vnc.sh \ - start-novnc.sh \ - /opt/bin/ - -#============================== -# Selenium Grid logo as wallpaper for Fluxbox -#============================== -COPY selenium_grid_logo.png /usr/share/images/fluxbox/ubuntu-light.png - -#============================ -# Some configuration options -#============================ -ENV SE_SCREEN_WIDTH 1360 -ENV SE_SCREEN_HEIGHT 1020 -ENV SE_SCREEN_DEPTH 24 -ENV SE_SCREEN_DPI 96 -ENV SE_START_XVFB true -# Temporal fix for https://github.com/SeleniumHQ/docker-selenium/issues/1610 -ENV START_XVFB true -ENV SE_START_NO_VNC true -ENV SE_NO_VNC_PORT 7900 -ENV SE_VNC_PORT 5900 -ENV DISPLAY :99.0 -ENV DISPLAY_NUM 99 -# Path to the Configfile -ENV CONFIG_FILE=/opt/selenium/config.toml -ENV GENERATE_CONFIG true -# Drain the Node after N sessions. -# A value higher than zero enables the feature -ENV SE_DRAIN_AFTER_SESSION_COUNT 0 - - - -#======================== -# Selenium Configuration -#======================== -# As integer, maps to "max-concurrent-sessions" -ENV SE_NODE_MAX_SESSIONS 1 -# As integer, maps to "session-timeout" in seconds -ENV SE_NODE_SESSION_TIMEOUT 300 -# As boolean, maps to "override-max-sessions" -ENV SE_NODE_OVERRIDE_MAX_SESSIONS false - -# Following line fixes https://github.com/SeleniumHQ/docker-selenium/issues/87 -ENV DBUS_SESSION_BUS_ADDRESS=/dev/null - -# Added to avoid sudo-related multi-arch build errors -USER root - -# Creating base directory for Xvfb -RUN mkdir -p /tmp/.X11-unix && chmod 1777 /tmp/.X11-unix - -# Added to avoid sudo-related multi-arch build errors -USER 1200 - -# Copying configuration script generator -COPY generate_config /opt/bin/generate_config - -EXPOSE 5900 diff --git a/NodeBase/generate.sh b/NodeBase/generate.sh deleted file mode 100755 index 6a7a10cf0..000000000 --- a/NodeBase/generate.sh +++ /dev/null @@ -1,13 +0,0 @@ -#!/usr/bin/env 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 ${NAMESPACE}/base:${VERSION} >> ./Dockerfile -echo LABEL authors="$AUTHORS" >> ./Dockerfile -echo "" >> ./Dockerfile -cat ./Dockerfile.txt >> ./Dockerfile diff --git a/NodeChrome/Dockerfile b/NodeChrome/Dockerfile index 7c526358d..aaaffcc2f 100644 --- a/NodeChrome/Dockerfile +++ b/NodeChrome/Dockerfile @@ -1,9 +1,8 @@ -# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -# NOTE: DO *NOT* EDIT THIS FILE. IT IS GENERATED. -# PLEASE UPDATE Dockerfile.txt INSTEAD OF THIS FILE -# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -FROM selenium/node-base:4.4.0-20220812 -LABEL authors=SeleniumHQ +ARG NAMESPACE +ARG VERSION +ARG AUTHORS +FROM ${NAMESPACE}/node-base:${VERSION} +LABEL authors=${AUTHORS} USER root diff --git a/NodeChrome/Dockerfile.txt b/NodeChrome/Dockerfile.txt deleted file mode 100644 index 0563826d9..000000000 --- a/NodeChrome/Dockerfile.txt +++ /dev/null @@ -1,54 +0,0 @@ -USER root - -#============================================ -# Google Chrome -#============================================ -# can specify versions by CHROME_VERSION; -# e.g. google-chrome-stable=53.0.2785.101-1 -# google-chrome-beta=53.0.2785.92-1 -# google-chrome-unstable=54.0.2840.14-1 -# latest (equivalent to google-chrome-stable) -# google-chrome-beta (pull latest beta) -#============================================ -ARG CHROME_VERSION="google-chrome-stable" -RUN wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add - \ - && echo "deb http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google-chrome.list \ - && apt-get update -qqy \ - && apt-get -qqy install \ - ${CHROME_VERSION:-google-chrome-stable} \ - && rm /etc/apt/sources.list.d/google-chrome.list \ - && rm -rf /var/lib/apt/lists/* /var/cache/apt/* - -#================================= -# Chrome Launch Script Wrapper -#================================= -COPY wrap_chrome_binary /opt/bin/wrap_chrome_binary -RUN /opt/bin/wrap_chrome_binary - -USER 1200 - -#============================================ -# Chrome webdriver -#============================================ -# can specify versions by CHROME_DRIVER_VERSION -# Latest released version will be used by default -#============================================ -ARG CHROME_DRIVER_VERSION -RUN if [ -z "$CHROME_DRIVER_VERSION" ]; \ - then CHROME_MAJOR_VERSION=$(google-chrome --version | sed -E "s/.* ([0-9]+)(\.[0-9]+){3}.*/\1/") \ - && CHROME_DRIVER_VERSION=$(wget --no-verbose -O - "https://chromedriver.storage.googleapis.com/LATEST_RELEASE_${CHROME_MAJOR_VERSION}"); \ - fi \ - && echo "Using chromedriver version: "$CHROME_DRIVER_VERSION \ - && wget --no-verbose -O /tmp/chromedriver_linux64.zip https://chromedriver.storage.googleapis.com/$CHROME_DRIVER_VERSION/chromedriver_linux64.zip \ - && rm -rf /opt/selenium/chromedriver \ - && unzip /tmp/chromedriver_linux64.zip -d /opt/selenium \ - && rm /tmp/chromedriver_linux64.zip \ - && mv /opt/selenium/chromedriver /opt/selenium/chromedriver-$CHROME_DRIVER_VERSION \ - && chmod 755 /opt/selenium/chromedriver-$CHROME_DRIVER_VERSION \ - && sudo ln -fs /opt/selenium/chromedriver-$CHROME_DRIVER_VERSION /usr/bin/chromedriver - - -#============================================ -# Dumping Browser name and version for config -#============================================ -RUN echo "chrome" > /opt/selenium/browser_name \ No newline at end of file diff --git a/NodeChrome/generate.sh b/NodeChrome/generate.sh deleted file mode 100755 index 8267ce323..000000000 --- a/NodeChrome/generate.sh +++ /dev/null @@ -1,13 +0,0 @@ -#!/usr/bin/env 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 ${NAMESPACE}/node-base:${VERSION} >> ./Dockerfile -echo LABEL authors="$AUTHORS" >> ./Dockerfile -echo "" >> ./Dockerfile -cat ./Dockerfile.txt >> ./Dockerfile diff --git a/NodeChromium/Dockerfile b/NodeChromium/Dockerfile index 8a80a712b..93e6a9d36 100644 --- a/NodeChromium/Dockerfile +++ b/NodeChromium/Dockerfile @@ -1,9 +1,8 @@ -# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -# NOTE: DO *NOT* EDIT THIS FILE. IT IS GENERATED. -# PLEASE UPDATE Dockerfile.txt INSTEAD OF THIS FILE -# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -FROM seleniarm/node-base:4.1.4-20220429 -LABEL authors=SeleniumHQ +ARG NAMESPACE +ARG VERSION +ARG AUTHORS +FROM ${NAMESPACE}/node-base:${VERSION} +LABEL authors=${AUTHORS} USER root diff --git a/NodeChromium/Dockerfile.txt b/NodeChromium/Dockerfile.txt deleted file mode 100644 index a3d87f071..000000000 --- a/NodeChromium/Dockerfile.txt +++ /dev/null @@ -1,31 +0,0 @@ -USER root - -# Install Chromium -# RUN echo "deb http://http.us.debian.org/debian/ stable non-free contrib main" >> /etc/apt/sources.list \ -RUN echo "deb http://deb.debian.org/debian/ sid main" >> /etc/apt/sources.list \ - && apt-get update -qqy \ - # && apt-get -qqy install chromium=89.0.4389.82-1 \ - # && apt-get -qqy install chromium=90.0.4430.212-1 \ - # && apt-get -qqy install chromium=93.0.4577.82-1 \ - # && apt-get -qqy install chromium=97.0.4692.71-0.1 \ - # && apt-get -qqy install chromium=98.0.4758.102-1+b1 \ - && apt-get -qqy install chromium \ - && rm -rf /var/lib/apt/lists/* /var/cache/apt/* - -#================================= -# Chromium Launch Script Wrapper -#================================= -COPY wrap_chromium_binary /opt/bin/wrap_chromium_binary -RUN /opt/bin/wrap_chromium_binary - -#============================================ -# Chromium webdriver -#============================================ -RUN apt-get update -qqy \ - && apt-get -qqy install chromium-driver \ - && rm -rf /var/lib/apt/lists/* /var/cache/apt/* - -RUN echo "chromium" > /opt/selenium/browser_name - -USER 1200 - diff --git a/NodeDocker/Dockerfile b/NodeDocker/Dockerfile index 42efe6951..249b91adc 100644 --- a/NodeDocker/Dockerfile +++ b/NodeDocker/Dockerfile @@ -1,9 +1,8 @@ -# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -# NOTE: DO *NOT* EDIT THIS FILE. IT IS GENERATED. -# PLEASE UPDATE Dockerfile.txt INSTEAD OF THIS FILE -# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -FROM selenium/base:4.4.0-20220812 -LABEL authors=SeleniumHQ +ARG NAMESPACE +ARG VERSION +ARG AUTHORS +FROM ${NAMESPACE}/base:${VERSION} +LABEL authors=${AUTHORS} USER root diff --git a/NodeDocker/Dockerfile.txt b/NodeDocker/Dockerfile.txt deleted file mode 100644 index dbf3a0a54..000000000 --- a/NodeDocker/Dockerfile.txt +++ /dev/null @@ -1,24 +0,0 @@ -USER root - -#============== -# Socat to proxy docker.sock when mounted -#============== -RUN apt-get update -qqy \ - && apt-get -qqy install socat \ - && rm -rf /var/lib/apt/lists/* /var/cache/apt/* - -USER 1200 - -#======================== -# Selenium Standalone Docker Configuration -#======================== - -EXPOSE 4444 - -COPY start-selenium-grid-docker.sh \ - config.toml \ - start-socat.sh \ - /opt/bin/ - -COPY selenium-grid-docker.conf /etc/supervisor/conf.d/ - diff --git a/NodeDocker/generate.sh b/NodeDocker/generate.sh deleted file mode 100755 index fdbf1a7b2..000000000 --- a/NodeDocker/generate.sh +++ /dev/null @@ -1,14 +0,0 @@ -#!/usr/bin/env 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 ${NAMESPACE}/base:${VERSION} >> ./Dockerfile -echo LABEL authors="$AUTHORS" >> ./Dockerfile -echo "" >> ./Dockerfile -cat ./Dockerfile.txt >> ./Dockerfile diff --git a/NodeEdge/Dockerfile b/NodeEdge/Dockerfile index 0679294b7..e874040b7 100644 --- a/NodeEdge/Dockerfile +++ b/NodeEdge/Dockerfile @@ -1,9 +1,8 @@ -# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -# NOTE: DO *NOT* EDIT THIS FILE. IT IS GENERATED. -# PLEASE UPDATE Dockerfile.txt INSTEAD OF THIS FILE -# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -FROM selenium/node-base:4.4.0-20220812 -LABEL authors=SeleniumHQ +ARG NAMESPACE +ARG VERSION +ARG AUTHORS +FROM ${NAMESPACE}/node-base:${VERSION} +LABEL authors=${AUTHORS} USER root diff --git a/NodeEdge/Dockerfile.txt b/NodeEdge/Dockerfile.txt deleted file mode 100644 index af49d07d8..000000000 --- a/NodeEdge/Dockerfile.txt +++ /dev/null @@ -1,48 +0,0 @@ -USER root - -#============================================ -# Microsoft Edge -#============================================ -# can specify versions by EDGE_VERSION; -# e.g. microsoft-edge-beta=88.0.692.0-1 -#============================================ -ARG EDGE_VERSION="microsoft-edge-stable" -RUN wget -q -O - https://packages.microsoft.com/keys/microsoft.asc | apt-key add - \ - && echo "deb https://packages.microsoft.com/repos/edge stable main" >> /etc/apt/sources.list.d/microsoft-edge.list \ - && apt-get update -qqy \ - && apt-get -qqy install ${EDGE_VERSION} \ - && rm /etc/apt/sources.list.d/microsoft-edge.list \ - && rm -rf /var/lib/apt/lists/* /var/cache/apt/* - -#================================= -# Edge Launch Script Wrapper -#================================= -COPY wrap_edge_binary /opt/bin/wrap_edge_binary -RUN /opt/bin/wrap_edge_binary - -USER 1200 - -#============================================ -# Edge webdriver -#============================================ -# can specify versions by EDGE_DRIVER_VERSION -# Latest released version will be used by default -#============================================ -ARG EDGE_DRIVER_VERSION -RUN if [ -z "$EDGE_DRIVER_VERSION" ]; \ - then EDGE_MAJOR_VERSION=$(microsoft-edge --version | sed -E "s/.* ([0-9]+)(\.[0-9]+){3}.*/\1/") \ - && EDGE_DRIVER_VERSION=$(wget --no-verbose -O - "https://msedgedriver.azureedge.net/LATEST_RELEASE_${EDGE_MAJOR_VERSION}_LINUX" | tr -cd "\11\12\15\40-\176" | tr -d "\r"); \ - fi \ - && echo "Using msedgedriver version: "$EDGE_DRIVER_VERSION \ - && wget --no-verbose -O /tmp/msedgedriver_linux64.zip https://msedgedriver.azureedge.net/$EDGE_DRIVER_VERSION/edgedriver_linux64.zip \ - && rm -rf /opt/selenium/msedgedriver \ - && unzip /tmp/msedgedriver_linux64.zip -d /opt/selenium \ - && rm /tmp/msedgedriver_linux64.zip \ - && mv /opt/selenium/msedgedriver /opt/selenium/msedgedriver-$EDGE_DRIVER_VERSION \ - && chmod 755 /opt/selenium/msedgedriver-$EDGE_DRIVER_VERSION \ - && sudo ln -fs /opt/selenium/msedgedriver-$EDGE_DRIVER_VERSION /usr/bin/msedgedriver - -#============================================ -# Dumping Browser name and version for config -#============================================ -RUN echo "MicrosoftEdge" > /opt/selenium/browser_name diff --git a/NodeEdge/generate.sh b/NodeEdge/generate.sh deleted file mode 100755 index 8267ce323..000000000 --- a/NodeEdge/generate.sh +++ /dev/null @@ -1,13 +0,0 @@ -#!/usr/bin/env 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 ${NAMESPACE}/node-base:${VERSION} >> ./Dockerfile -echo LABEL authors="$AUTHORS" >> ./Dockerfile -echo "" >> ./Dockerfile -cat ./Dockerfile.txt >> ./Dockerfile diff --git a/NodeFirefox/Dockerfile b/NodeFirefox/Dockerfile index 5ca2cce0e..14e18f072 100644 --- a/NodeFirefox/Dockerfile +++ b/NodeFirefox/Dockerfile @@ -1,60 +1,40 @@ -# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -# NOTE: DO *NOT* EDIT THIS FILE. IT IS GENERATED. -# PLEASE UPDATE Dockerfile.txt INSTEAD OF THIS FILE -# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -FROM selenium/node-base:4.4.0-20220812 -LABEL authors=SeleniumHQ - -ARG TARGETARCH -ARG TARGETVARIANT - -ARG GECKODRIVER_VERSION=0.31.0 +ARG NAMESPACE +ARG VERSION +ARG AUTHORS +FROM ${NAMESPACE}/node-base:${VERSION} +LABEL authors=${AUTHORS} USER root #========= # Firefox #========= -#RUN echo "deb http://deb.debian.org/debian/ sid main" >> /etc/apt/sources.list \ - # && apt-get update -qqy \ - # && apt-get -qqy install firefox-esr libavcodec-extra \ - # && apt-get -qqy install firefox libavcodec-extra \ - # && rm -rf /var/lib/apt/lists/* /var/cache/apt/* - -# Pulling Firefox from Debian Snapshots so we can control which version we use as latest -RUN echo "deb http://deb.debian.org/debian/ sid main" >> /etc/apt/sources.list \ +ARG FIREFOX_VERSION=latest +RUN FIREFOX_DOWNLOAD_URL=$(if [ $FIREFOX_VERSION = "latest" ] || [ $FIREFOX_VERSION = "nightly-latest" ] || [ $FIREFOX_VERSION = "devedition-latest" ] || [ $FIREFOX_VERSION = "esr-latest" ]; then echo "https://download.mozilla.org/?product=firefox-$FIREFOX_VERSION-ssl&os=linux64&lang=en-US"; else echo "https://download-installer.cdn.mozilla.net/pub/firefox/releases/$FIREFOX_VERSION/linux-x86_64/en-US/firefox-$FIREFOX_VERSION.tar.bz2"; fi) \ && apt-get update -qqy \ - && apt-get install libavcodec-extra -y \ - && wget https://snapshot.debian.org/archive/debian/20220418T084218Z/pool/main/f/firefox/firefox_99.0-1_`dpkg --print-architecture`.deb -O firefox.deb \ - && apt install ./firefox.deb -y \ - && rm -rf /var/lib/apt/lists/* /var/cache/apt/* ./firefox.deb - -#============= -# geckodriver -#============= -RUN if [ $TARGETARCH = "arm" ] && [ $TARGETVARIANT = "v7" ]; then \ - export ARCH=armhf ; \ - else \ - export ARCH=$TARGETARCH ; \ - fi ; \ - if [ -z "$ARCH" ]; then \ - echo "*** BUILD ERROR: \$TARGETARCH must be arm64, amd64, or arm with \$TARGETVARIANT set to v7... exiting..." ; \ - exit 1 ; \ - fi ; \ - if [ "$ARCH" = "arm64" ]; then \ - wget --no-verbose -O /tmp/geckodriver.tar.gz https://github.com/jamesmortensen/geckodriver-arm-binaries/releases/download/v$GECKODRIVER_VERSION/geckodriver-v$GECKODRIVER_VERSION-linux-aarch64.tar.gz ; \ - elif [ "$ARCH" = "armhf" ]; then \ - wget --no-verbose -O /tmp/geckodriver.tar.gz https://github.com/jamesmortensen/geckodriver-arm-binaries/releases/download/v$GECKODRIVER_VERSION/geckodriver-v$GECKODRIVER_VERSION-linux-armv7l.tar.gz ; \ - else \ - wget --no-verbose -O /tmp/geckodriver.tar.gz https://github.com/mozilla/geckodriver/releases/download/v$GECKODRIVER_VERSION/geckodriver-v$GECKODRIVER_VERSION-linux64.tar.gz ; \ - fi ; \ - tar -C /tmp -zxf /tmp/geckodriver.tar.gz ; \ - rm /tmp/geckodriver.tar.gz ; \ - mkdir -p /opt/geckodriver-bin ; \ - mv /tmp/geckodriver /opt/geckodriver-bin/geckodriver ; \ - echo "Symlinking geckodriver to /usr/local/bin/geckodriver" ; \ - ln -s /opt/geckodriver-bin/geckodriver /usr/local/bin/geckodriver ; \ - chmod 755 /usr/local/bin/geckodriver + && apt-get -qqy --no-install-recommends install firefox libavcodec-extra \ + && rm -rf /var/lib/apt/lists/* /var/cache/apt/* \ + && wget --no-verbose -O /tmp/firefox.tar.bz2 $FIREFOX_DOWNLOAD_URL \ + && apt-get -y purge firefox \ + && rm -rf /opt/firefox \ + && tar -C /opt -xjf /tmp/firefox.tar.bz2 \ + && rm /tmp/firefox.tar.bz2 \ + && mv /opt/firefox /opt/firefox-$FIREFOX_VERSION \ + && ln -fs /opt/firefox-$FIREFOX_VERSION/firefox /usr/bin/firefox + +#============ +# GeckoDriver +#============ +ARG GECKODRIVER_VERSION=latest +RUN GK_VERSION=$(if [ ${GECKODRIVER_VERSION:-latest} = "latest" ]; then echo "0.31.0"; else echo $GECKODRIVER_VERSION; fi) \ + && echo "Using GeckoDriver version: "$GK_VERSION \ + && wget --no-verbose -O /tmp/geckodriver.tar.gz https://github.com/mozilla/geckodriver/releases/download/v$GK_VERSION/geckodriver-v$GK_VERSION-linux64.tar.gz \ + && rm -rf /opt/geckodriver \ + && tar -C /opt -zxf /tmp/geckodriver.tar.gz \ + && rm /tmp/geckodriver.tar.gz \ + && mv /opt/geckodriver /opt/geckodriver-$GK_VERSION \ + && chmod 755 /opt/geckodriver-$GK_VERSION \ + && ln -fs /opt/geckodriver-$GK_VERSION /usr/bin/geckodriver USER 1200 diff --git a/NodeFirefox/Dockerfile.arm64 b/NodeFirefox/Dockerfile.arm64 index 66fe1d263..6ee949a11 100644 --- a/NodeFirefox/Dockerfile.arm64 +++ b/NodeFirefox/Dockerfile.arm64 @@ -1,5 +1,8 @@ -#FROM local-seleniarm/node-base:4.0.0-20211018 -#LABEL authors=SeleniumHQ,sj26,jamesmortensen +ARG NAMESPACE +ARG VERSION +ARG AUTHORS +FROM ${NAMESPACE}/node-base:${VERSION} +LABEL authors=${AUTHORS} ARG TARGETARCH ARG TARGETVARIANT diff --git a/NodeFirefox/Dockerfile.txt b/NodeFirefox/Dockerfile.txt deleted file mode 100644 index 27db2bd93..000000000 --- a/NodeFirefox/Dockerfile.txt +++ /dev/null @@ -1,38 +0,0 @@ -USER root - -#========= -# Firefox -#========= -ARG FIREFOX_VERSION=latest -RUN FIREFOX_DOWNLOAD_URL=$(if [ $FIREFOX_VERSION = "latest" ] || [ $FIREFOX_VERSION = "nightly-latest" ] || [ $FIREFOX_VERSION = "devedition-latest" ] || [ $FIREFOX_VERSION = "esr-latest" ]; then echo "https://download.mozilla.org/?product=firefox-$FIREFOX_VERSION-ssl&os=linux64&lang=en-US"; else echo "https://download-installer.cdn.mozilla.net/pub/firefox/releases/$FIREFOX_VERSION/linux-x86_64/en-US/firefox-$FIREFOX_VERSION.tar.bz2"; fi) \ - && apt-get update -qqy \ - && apt-get -qqy --no-install-recommends install firefox libavcodec-extra \ - && rm -rf /var/lib/apt/lists/* /var/cache/apt/* \ - && wget --no-verbose -O /tmp/firefox.tar.bz2 $FIREFOX_DOWNLOAD_URL \ - && apt-get -y purge firefox \ - && rm -rf /opt/firefox \ - && tar -C /opt -xjf /tmp/firefox.tar.bz2 \ - && rm /tmp/firefox.tar.bz2 \ - && mv /opt/firefox /opt/firefox-$FIREFOX_VERSION \ - && ln -fs /opt/firefox-$FIREFOX_VERSION/firefox /usr/bin/firefox - -#============ -# GeckoDriver -#============ -ARG GECKODRIVER_VERSION=latest -RUN GK_VERSION=$(if [ ${GECKODRIVER_VERSION:-latest} = "latest" ]; then echo "0.31.0"; else echo $GECKODRIVER_VERSION; fi) \ - && echo "Using GeckoDriver version: "$GK_VERSION \ - && wget --no-verbose -O /tmp/geckodriver.tar.gz https://github.com/mozilla/geckodriver/releases/download/v$GK_VERSION/geckodriver-v$GK_VERSION-linux64.tar.gz \ - && rm -rf /opt/geckodriver \ - && tar -C /opt -zxf /tmp/geckodriver.tar.gz \ - && rm /tmp/geckodriver.tar.gz \ - && mv /opt/geckodriver /opt/geckodriver-$GK_VERSION \ - && chmod 755 /opt/geckodriver-$GK_VERSION \ - && ln -fs /opt/geckodriver-$GK_VERSION /usr/bin/geckodriver - -USER 1200 - -#============================================ -# Dumping Browser name and version for config -#============================================ -RUN echo "firefox" > /opt/selenium/browser_name diff --git a/NodeFirefox/generate-arm.sh b/NodeFirefox/generate-arm.sh deleted file mode 100755 index ff8e39db3..000000000 --- a/NodeFirefox/generate-arm.sh +++ /dev/null @@ -1,18 +0,0 @@ -#!/bin/bash -echo 'Generate the Dockerfile.arm64...' -BUILD_DATE=$(date +'%Y%m%d') -VERSION=4.1.2 -TAG_VERSION=${1:-$VERSION-$BUILD_DATE} -NAMESPACE="${2:-local-seleniarm}" -AUTHORS="${3:-SeleniumHQ,sj26,jamesmortensen}" - -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 ${NAMESPACE}/node-base:${VERSION}-${BUILD_DATE} >> ./Dockerfile -echo FROM ${NAMESPACE}/node-base:${TAG_VERSION} >> ./Dockerfile -echo LABEL authors="$AUTHORS" >> ./Dockerfile -echo "" >> ./Dockerfile -cat ./Dockerfile.arm64 >> ./Dockerfile - diff --git a/NodeFirefox/generate.sh b/NodeFirefox/generate.sh deleted file mode 100755 index 8267ce323..000000000 --- a/NodeFirefox/generate.sh +++ /dev/null @@ -1,13 +0,0 @@ -#!/usr/bin/env 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 ${NAMESPACE}/node-base:${VERSION} >> ./Dockerfile -echo LABEL authors="$AUTHORS" >> ./Dockerfile -echo "" >> ./Dockerfile -cat ./Dockerfile.txt >> ./Dockerfile diff --git a/Router/Dockerfile b/Router/Dockerfile index 8d92093da..ccce7a2ff 100644 --- a/Router/Dockerfile +++ b/Router/Dockerfile @@ -1,9 +1,8 @@ -# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -# NOTE: DO *NOT* EDIT THIS FILE. IT IS GENERATED. -# PLEASE UPDATE Dockerfile.txt INSTEAD OF THIS FILE -# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -FROM selenium/base:4.4.0-20220812 -LABEL authors=SeleniumHQ +ARG NAMESPACE +ARG VERSION +ARG AUTHORS +FROM ${NAMESPACE}/base:${VERSION} +LABEL authors=${AUTHORS} USER 1200 diff --git a/Router/Dockerfile.txt b/Router/Dockerfile.txt deleted file mode 100644 index db21f68e5..000000000 --- a/Router/Dockerfile.txt +++ /dev/null @@ -1,17 +0,0 @@ -USER 1200 - -#======================== -# Selenium Router Configuration -#======================== - -# In seconds, maps to "--session-request-timeout" -ENV SE_SESSION_REQUEST_TIMEOUT 300 -# In seconds, maps to "--session-retry-interval" -ENV SE_SESSION_RETRY_INTERVAL 0 - -EXPOSE 4444 - -COPY start-selenium-grid-router.sh \ - /opt/bin/ - -COPY selenium-grid-router.conf /etc/supervisor/conf.d/ diff --git a/Router/generate.sh b/Router/generate.sh deleted file mode 100755 index fdbf1a7b2..000000000 --- a/Router/generate.sh +++ /dev/null @@ -1,14 +0,0 @@ -#!/usr/bin/env 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 ${NAMESPACE}/base:${VERSION} >> ./Dockerfile -echo LABEL authors="$AUTHORS" >> ./Dockerfile -echo "" >> ./Dockerfile -cat ./Dockerfile.txt >> ./Dockerfile diff --git a/SessionQueue/Dockerfile b/SessionQueue/Dockerfile index a9ba7819e..bf6213279 100644 --- a/SessionQueue/Dockerfile +++ b/SessionQueue/Dockerfile @@ -1,9 +1,8 @@ -# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -# NOTE: DO *NOT* EDIT THIS FILE. IT IS GENERATED. -# PLEASE UPDATE Dockerfile.txt INSTEAD OF THIS FILE -# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -FROM selenium/base:4.4.0-20220812 -LABEL authors=SeleniumHQ +ARG NAMESPACE +ARG VERSION +ARG AUTHORS +FROM ${NAMESPACE}/base:${VERSION} +LABEL authors=${AUTHORS} USER 1200 diff --git a/SessionQueue/Dockerfile.txt b/SessionQueue/Dockerfile.txt deleted file mode 100644 index 9a224ca48..000000000 --- a/SessionQueue/Dockerfile.txt +++ /dev/null @@ -1,17 +0,0 @@ -USER 1200 - -#======================== -# Selenium SessionQueue Configuration -#======================== - -# In seconds, maps to "--session-request-timeout" -ENV SE_SESSION_REQUEST_TIMEOUT 300 -# In seconds, maps to "--session-retry-interval" -ENV SE_SESSION_RETRY_INTERVAL 15 - -EXPOSE 5559 - -COPY start-selenium-grid-session-queue.sh \ - /opt/bin/ - -COPY selenium-grid-session-queue.conf /etc/supervisor/conf.d/ diff --git a/SessionQueue/generate.sh b/SessionQueue/generate.sh deleted file mode 100755 index fdbf1a7b2..000000000 --- a/SessionQueue/generate.sh +++ /dev/null @@ -1,14 +0,0 @@ -#!/usr/bin/env 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 ${NAMESPACE}/base:${VERSION} >> ./Dockerfile -echo LABEL authors="$AUTHORS" >> ./Dockerfile -echo "" >> ./Dockerfile -cat ./Dockerfile.txt >> ./Dockerfile diff --git a/Sessions/Dockerfile b/Sessions/Dockerfile index a64505454..b069e84f7 100644 --- a/Sessions/Dockerfile +++ b/Sessions/Dockerfile @@ -1,9 +1,8 @@ -# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -# NOTE: DO *NOT* EDIT THIS FILE. IT IS GENERATED. -# PLEASE UPDATE Dockerfile.txt INSTEAD OF THIS FILE -# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -FROM selenium/base:4.4.0-20220812 -LABEL authors=SeleniumHQ +ARG NAMESPACE +ARG VERSION +ARG AUTHORS +FROM ${NAMESPACE}/base:${VERSION} +LABEL authors=${AUTHORS} USER 1200 diff --git a/Sessions/Dockerfile.txt b/Sessions/Dockerfile.txt deleted file mode 100644 index 866f9042d..000000000 --- a/Sessions/Dockerfile.txt +++ /dev/null @@ -1,12 +0,0 @@ -USER 1200 - -#======================== -# Selenium SessionMap Configuration -#======================== - -EXPOSE 5556 - -COPY start-selenium-grid-sessions.sh \ - /opt/bin/ - -COPY selenium-grid-sessions.conf /etc/supervisor/conf.d/ diff --git a/Sessions/generate.sh b/Sessions/generate.sh deleted file mode 100755 index fdbf1a7b2..000000000 --- a/Sessions/generate.sh +++ /dev/null @@ -1,14 +0,0 @@ -#!/usr/bin/env 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 ${NAMESPACE}/base:${VERSION} >> ./Dockerfile -echo LABEL authors="$AUTHORS" >> ./Dockerfile -echo "" >> ./Dockerfile -cat ./Dockerfile.txt >> ./Dockerfile diff --git a/Standalone/Dockerfile.txt b/Standalone/Dockerfile similarity index 82% rename from Standalone/Dockerfile.txt rename to Standalone/Dockerfile index 61bdf6e34..addb83f9c 100644 --- a/Standalone/Dockerfile.txt +++ b/Standalone/Dockerfile @@ -1,3 +1,10 @@ +ARG NAMESPACE +ARG VERSION +ARG AUTHORS +ARG BASE +FROM ${NAMESPACE}/${BASE}:${VERSION} +LABEL authors=${AUTHORS} + USER 1200 #==================================== diff --git a/Standalone/generate.sh b/Standalone/generate.sh deleted file mode 100755 index 30208b492..000000000 --- a/Standalone/generate.sh +++ /dev/null @@ -1,19 +0,0 @@ -#!/usr/bin/env bash -FOLDER=../$1 -BASE=$2 -VERSION=$3 -NAMESPACE=$4 -AUTHORS=$5 - -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 ${NAMESPACE}/${BASE}:${VERSION} >> ${FOLDER}/Dockerfile -echo LABEL authors="$AUTHORS" >> ${FOLDER}/Dockerfile -echo "" >> ${FOLDER}/Dockerfile -cat ./Dockerfile.txt >> ${FOLDER}/Dockerfile - -cp ./start-selenium-standalone.sh ${FOLDER} -cp ./selenium.conf ${FOLDER} -cp ./generate_config ${FOLDER} diff --git a/StandaloneChrome/Dockerfile b/StandaloneChrome/Dockerfile deleted file mode 100644 index bfb50dc70..000000000 --- a/StandaloneChrome/Dockerfile +++ /dev/null @@ -1,28 +0,0 @@ -# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -# NOTE: DO *NOT* EDIT THIS FILE. IT IS GENERATED. -# PLEASE UPDATE Dockerfile.txt INSTEAD OF THIS FILE -# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -FROM selenium/node-chrome:4.4.0-20220812 -LABEL authors=SeleniumHQ - -USER 1200 - -#==================================== -# Scripts to run Selenium Standalone -#==================================== -COPY start-selenium-standalone.sh /opt/bin/start-selenium-standalone.sh - -#============================== -# Supervisor configuration file -#============================== -COPY selenium.conf /etc/supervisor/conf.d/ - -# Copying configuration script generator -COPY generate_config /opt/bin/generate_config - -# Boolean value, maps "--relax-checks" -ENV SE_RELAX_CHECKS true - -EXPOSE 4444 - - diff --git a/StandaloneChromium/Dockerfile b/StandaloneChromium/Dockerfile deleted file mode 100644 index 58b2c3316..000000000 --- a/StandaloneChromium/Dockerfile +++ /dev/null @@ -1,28 +0,0 @@ -# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -# NOTE: DO *NOT* EDIT THIS FILE. IT IS GENERATED. -# PLEASE UPDATE Dockerfile.txt INSTEAD OF THIS FILE -# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -FROM seleniarm/node-chromium:4.1.4-20220429 -LABEL authors=SeleniumHQ - -USER 1200 - -#==================================== -# Scripts to run Selenium Standalone -#==================================== -COPY start-selenium-standalone.sh /opt/bin/start-selenium-standalone.sh - -#============================== -# Supervisor configuration file -#============================== -COPY selenium.conf /etc/supervisor/conf.d/ - -# Copying configuration script generator -COPY generate_config /opt/bin/generate_config - -# Boolean value, maps "--relax-checks" -ENV SE_RELAX_CHECKS true - -EXPOSE 4444 - - diff --git a/StandaloneDocker/Dockerfile b/StandaloneDocker/Dockerfile index 335e29310..166d902ac 100644 --- a/StandaloneDocker/Dockerfile +++ b/StandaloneDocker/Dockerfile @@ -1,9 +1,8 @@ -# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -# NOTE: DO *NOT* EDIT THIS FILE. IT IS GENERATED. -# PLEASE UPDATE Dockerfile.txt INSTEAD OF THIS FILE -# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -FROM selenium/node-docker:4.4.0-20220812 -LABEL authors=SeleniumHQ +ARG NAMESPACE +ARG VERSION +ARG AUTHORS +FROM ${NAMESPACE}/node-docker:${VERSION} +LABEL authors=${AUTHORS} USER 1200 diff --git a/StandaloneDocker/Dockerfile.txt b/StandaloneDocker/Dockerfile.txt deleted file mode 100644 index 600283299..000000000 --- a/StandaloneDocker/Dockerfile.txt +++ /dev/null @@ -1,12 +0,0 @@ -USER 1200 - -#======================== -# Selenium Standalone Docker Configuration -#======================== - -EXPOSE 4444 - -COPY start-selenium-grid-docker.sh /opt/bin/ - -# Boolean value, maps "--relax-checks" -ENV SE_RELAX_CHECKS true diff --git a/StandaloneDocker/generate.sh b/StandaloneDocker/generate.sh deleted file mode 100755 index 615132dfb..000000000 --- a/StandaloneDocker/generate.sh +++ /dev/null @@ -1,14 +0,0 @@ -#!/usr/bin/env 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 ${NAMESPACE}/node-docker:${VERSION} >> ./Dockerfile -echo LABEL authors="$AUTHORS" >> ./Dockerfile -echo "" >> ./Dockerfile -cat ./Dockerfile.txt >> ./Dockerfile diff --git a/StandaloneEdge/Dockerfile b/StandaloneEdge/Dockerfile deleted file mode 100644 index 69a2c73c8..000000000 --- a/StandaloneEdge/Dockerfile +++ /dev/null @@ -1,28 +0,0 @@ -# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -# NOTE: DO *NOT* EDIT THIS FILE. IT IS GENERATED. -# PLEASE UPDATE Dockerfile.txt INSTEAD OF THIS FILE -# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -FROM selenium/node-edge:4.4.0-20220812 -LABEL authors=SeleniumHQ - -USER 1200 - -#==================================== -# Scripts to run Selenium Standalone -#==================================== -COPY start-selenium-standalone.sh /opt/bin/start-selenium-standalone.sh - -#============================== -# Supervisor configuration file -#============================== -COPY selenium.conf /etc/supervisor/conf.d/ - -# Copying configuration script generator -COPY generate_config /opt/bin/generate_config - -# Boolean value, maps "--relax-checks" -ENV SE_RELAX_CHECKS true - -EXPOSE 4444 - - diff --git a/StandaloneFirefox/Dockerfile b/StandaloneFirefox/Dockerfile deleted file mode 100644 index 008b7d114..000000000 --- a/StandaloneFirefox/Dockerfile +++ /dev/null @@ -1,28 +0,0 @@ -# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -# NOTE: DO *NOT* EDIT THIS FILE. IT IS GENERATED. -# PLEASE UPDATE Dockerfile.txt INSTEAD OF THIS FILE -# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -FROM selenium/node-firefox:4.4.0-20220812 -LABEL authors=SeleniumHQ - -USER 1200 - -#==================================== -# Scripts to run Selenium Standalone -#==================================== -COPY start-selenium-standalone.sh /opt/bin/start-selenium-standalone.sh - -#============================== -# Supervisor configuration file -#============================== -COPY selenium.conf /etc/supervisor/conf.d/ - -# Copying configuration script generator -COPY generate_config /opt/bin/generate_config - -# Boolean value, maps "--relax-checks" -ENV SE_RELAX_CHECKS true - -EXPOSE 4444 - - diff --git a/generate_release_notes.sh b/generate_release_notes.sh index 57dbcf950..014f56156 100755 --- a/generate_release_notes.sh +++ b/generate_release_notes.sh @@ -14,7 +14,7 @@ git --no-pager log "${LATEST_TAG}...${HEAD_BRANCH}" --pretty=format:"* [\`%h\`]( CHROME_VERSION=$(docker run --rm selenium/node-chrome:${TAG_VERSION} google-chrome --version | awk '{print $3}') EDGE_VERSION=$(docker run --rm selenium/node-edge:${TAG_VERSION} microsoft-edge --version | awk '{print $3}') CHROMEDRIVER_VERSION=$(docker run --rm selenium/node-chrome:${TAG_VERSION} chromedriver --version | awk '{print $2}') -EDGEDRIVER_VERSION=$(docker run --rm selenium/node-edge:${TAG_VERSION} msedgedriver --version | awk '{print $2}') +EDGEDRIVER_VERSION=$(docker run --rm selenium/node-edge:${TAG_VERSION} msedgedriver --version | awk '{print $4}') FIREFOX_VERSION=$(docker run --rm selenium/node-firefox:${TAG_VERSION} firefox --version | awk '{print $3}') GECKODRIVER_VERSION=$(docker run --rm selenium/node-firefox:${TAG_VERSION} geckodriver --version | awk 'NR==1{print $2}') FFMPEG_VERSION=$(docker run --entrypoint="" --rm selenium/video:ffmpeg-4.3.1-${BUILD_DATE} ffmpeg -version | awk '{print $3}' | head -n 1) diff --git a/tag_and_push_browser_images.sh b/tag_and_push_browser_images.sh index 4e192e8e3..aa2744e66 100755 --- a/tag_and_push_browser_images.sh +++ b/tag_and_push_browser_images.sh @@ -69,7 +69,7 @@ edge) EDGE_SHORT_VERSION="$(short_version ${EDGE_VERSION})" echo "Short Edge version -> "${EDGE_SHORT_VERSION} - EDGEDRIVER_VERSION=$(docker run --rm selenium/node-edge:${TAG_VERSION} msedgedriver --version | awk '{print $2}') + EDGEDRIVER_VERSION=$(docker run --rm selenium/node-edge:${TAG_VERSION} msedgedriver --version | awk '{print $4}') echo "EdgeDriver version -> "${EDGEDRIVER_VERSION} EDGEDRIVER_SHORT_VERSION="$(short_version ${EDGEDRIVER_VERSION})" echo "Short EdgeDriver version -> "${EDGEDRIVER_SHORT_VERSION} diff --git a/tests/test.py b/tests/test.py index c3f7e0e77..3268dc9d0 100644 --- a/tests/test.py +++ b/tests/test.py @@ -3,6 +3,7 @@ import random import sys import unittest +import re import docker from docker.errors import NotFound @@ -62,6 +63,10 @@ 'StandaloneChromium': 'ChromeTests', } +FROM_IMAGE_ARGS = { + 'NAMESPACE': NAMESPACE, + 'VERSION': VERSION +} def launch_hub(network_name): """ @@ -118,9 +123,12 @@ def launch_container(container, **kwargs): else: # Build the container if it doesn't exist logger.info("Building %s container..." % container) - client.images.build(path='../%s' % container, + set_from_image_base_for_standalone(container) + build_path = get_build_path(container) + client.images.build(path='../%s' % build_path, tag="%s/%s:%s" % (NAMESPACE, IMAGE_NAME_MAP[container], VERSION), - rm=True) + rm=True, + buildargs=FROM_IMAGE_ARGS) logger.info("Done building %s" % container) # Run the container @@ -143,6 +151,24 @@ def launch_container(container, **kwargs): return container_id +def set_from_image_base_for_standalone(container): + match = standalone_browser_container_matches(container) + if match != None: + FROM_IMAGE_ARGS['BASE'] = 'node-' + match.group(2).lower() + + +def get_build_path(container): + match = standalone_browser_container_matches(container) + if match == None: + return container + else: + return match.group(1) + + +def standalone_browser_container_matches(container): + return re.match("(Standalone)(Chromium|Chrome|Firefox|Edge)", container) + + if __name__ == '__main__': # The container to test against image = sys.argv[1]