Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: warning LegacyKeyValueFormat in Dockerfile #2314

Merged
merged 1 commit into from
Jul 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 10 additions & 14 deletions Base/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,17 @@ LABEL authors="Selenium <[email protected]>"
ARG VERSION
ARG RELEASE=selenium-${VERSION}
ARG AUTHORS=SeleniumHQ
# Default value should be aligned with upstream Selenium (https://github.com/SeleniumHQ/selenium/blob/trunk/java/maven_deps.bzl)
ARG OPENTELEMETRY_VERSION=1.38.0
ARG GRPC_VERSION=1.64.0
ARG NETTY_VERSION=4.1.108.Final
# Default value should be aligned with upstream Selenium (https://github.com/SeleniumHQ/selenium/blob/trunk/MODULE.bazel)
ARG OPENTELEMETRY_VERSION=1.40.0
ARG GRPC_VERSION=1.65.1
ARG NETTY_VERSION=4.1.111.Final
ARG CS_VERSION=2.1.10

#Arguments to define the user running Selenium
ARG SEL_USER=seluser
ARG SEL_GROUP=${SEL_USER}
ARG SEL_PASSWD=secret
ARG HOME=/home/${SEL_USER}
ARG UID=1200
ARG GID=1201
ARG TZ="UTC"
Expand All @@ -30,7 +31,7 @@ ENV DEBIAN_FRONTEND=noninteractive \
SEL_USER=${SEL_USER} \
SEL_UID=${UID} \
SEL_GID=${GID} \
HOME=/home/${SEL_USER} \
HOME=${HOME} \
TZ=${TZ} \
SEL_DOWNLOAD_DIR=${HOME}/Downloads

Expand Down Expand Up @@ -58,18 +59,13 @@ RUN if [ "$(dpkg --print-architecture)" = "amd64" ]; then \
supervisor \
gnupg2 \
libnss3-tools \
&& mkdir -p /etc/apt/keyrings \
&& apt-key adv --keyserver hkps://keyserver.ubuntu.com:443 --recv-keys 843C48A565F8F04B || apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 843C48A565F8F04B \
&& wget -qO - https://packages.adoptium.net/artifactory/api/gpg/key/public | tee /etc/apt/keyrings/adoptium.asc >dev/null \
&& echo "deb [signed-by=/etc/apt/keyrings/adoptium.asc] https://packages.adoptium.net/artifactory/deb $(awk -F= '/^VERSION_CODENAME/{print$2}' /etc/os-release) main" | tee /etc/apt/sources.list.d/adoptium.list >dev/null \
&& apt-get -qqy update \
&& apt-get -qqy --no-install-recommends install temurin-${JRE_VERSION}-jre -y \
openjdk-${JRE_VERSION}-jre-headless \
&& if [ "${TARGETARCH}" = "arm" ] && [ "${TARGETVARIANT}" = "v7" ]; then \
export ARCH=armhf ; \
else \
export ARCH=$(dpkg --print-architecture) ; \
fi \
&& sed -i 's/securerandom\.source=file:\/dev\/random/securerandom\.source=file:\/dev\/urandom/' ./usr/lib/jvm/temurin-${JRE_VERSION}-jre-${ARCH}/conf/security/java.security \
&& sed -i 's/securerandom\.source=file:\/dev\/random/securerandom\.source=file:\/dev\/urandom/' /usr/lib/jvm/java-${JRE_VERSION}-openjdk-${ARCH}/conf/security/java.security \
&& rm -rf /var/lib/apt/lists/* /var/cache/apt/* \
#===================
# Timezone settings
Expand All @@ -95,9 +91,9 @@ RUN if [ "$(dpkg --print-architecture)" = "amd64" ]; then \
# Selenium & relaxing permissions for OpenShift and other non-sudo environments
#==========
&& mkdir -p /opt/selenium /opt/selenium/assets /var/run/supervisor /var/log/supervisor ${SEL_DOWNLOAD_DIR} \
${HOME}/.mozilla ${HOME}/.vnc $HOME/.pki/nssdb \
${HOME}/.mozilla ${HOME}/.vnc ${HOME}/.pki/nssdb \
# NSSDB initialization with an empty password
&& certutil -d sql:$HOME/.pki/nssdb -N --empty-password \
&& certutil -d sql:${HOME}/.pki/nssdb -N --empty-password \
&& touch /opt/selenium/config.toml \
&& chown -R ${SEL_USER}:${SEL_GROUP} /opt/selenium /var/run/supervisor /var/log/supervisor /etc/passwd ${HOME} \
&& chmod -R 775 /opt/selenium /var/run/supervisor /var/log/supervisor /etc/passwd ${HOME} \
Expand Down
11 changes: 5 additions & 6 deletions Distributor/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
ARG NAMESPACE
ARG VERSION
ARG AUTHORS
FROM ${NAMESPACE}/base:${VERSION}
ARG AUTHORS
LABEL authors=${AUTHORS}

USER ${SEL_UID}
Expand All @@ -18,10 +18,9 @@ COPY --chown="${SEL_UID}:${SEL_GID}" start-selenium-grid-distributor.sh \
COPY selenium-grid-distributor.conf /etc/supervisor/conf.d/

# In seconds, maps to "--session-request-timeout"
ENV SE_SESSION_REQUEST_TIMEOUT 300
ENV SE_SESSION_REQUEST_TIMEOUT=300 \
# In seconds, maps to "--session-retry-interval"
ENV SE_SESSION_RETRY_INTERVAL 15
SE_SESSION_RETRY_INTERVAL=15 \
# In seconds, maps to "--healthcheck-interval"
ENV SE_HEALTHCHECK_INTERVAL 120

ENV SE_OTEL_SERVICE_NAME "selenium-distributor"
SE_HEALTHCHECK_INTERVAL=120 \
SE_OTEL_SERVICE_NAME="selenium-distributor"
4 changes: 2 additions & 2 deletions EventBus/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
ARG NAMESPACE
ARG VERSION
ARG AUTHORS
FROM ${NAMESPACE}/base:${VERSION}
ARG AUTHORS
LABEL authors=${AUTHORS}

USER ${SEL_UID}
Expand All @@ -22,4 +22,4 @@ COPY --chown="${SEL_UID}:${SEL_GID}" start-selenium-grid-eventbus.sh \

COPY selenium-grid-eventbus.conf /etc/supervisor/conf.d/

ENV SE_OTEL_SERVICE_NAME "selenium-event-bus"
ENV SE_OTEL_SERVICE_NAME="selenium-event-bus"
13 changes: 6 additions & 7 deletions Hub/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
ARG NAMESPACE
ARG VERSION
ARG AUTHORS
FROM ${NAMESPACE}/base:${VERSION}
ARG AUTHORS
LABEL authors=${AUTHORS}

USER ${SEL_UID}
Expand All @@ -15,17 +15,16 @@ EXPOSE 4443
EXPOSE 4444

# In seconds, maps to "--session-request-timeout"
ENV SE_SESSION_REQUEST_TIMEOUT 300
ENV SE_SESSION_REQUEST_TIMEOUT=300 \
# In seconds, maps to "--session-retry-interval"
ENV SE_SESSION_RETRY_INTERVAL 15
SE_SESSION_RETRY_INTERVAL=15 \
# In seconds, maps to "--healthcheck-interval"
ENV SE_HEALTHCHECK_INTERVAL 120
SE_HEALTHCHECK_INTERVAL=120 \
# Boolean value, maps "--relax-checks"
ENV SE_RELAX_CHECKS true
SE_RELAX_CHECKS=true \
SE_OTEL_SERVICE_NAME="selenium-hub"

COPY --chown="${SEL_UID}:${SEL_GID}" start-selenium-grid-hub.sh \
/opt/bin/

COPY selenium-grid-hub.conf /etc/supervisor/conf.d/

ENV SE_OTEL_SERVICE_NAME "selenium-hub"
5 changes: 3 additions & 2 deletions NodeBase/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
ARG NAMESPACE
ARG VERSION
ARG AUTHORS
FROM ${NAMESPACE}/base:${VERSION}
ARG AUTHORS
LABEL authors=${AUTHORS}

# Inputs: heads, tags
Expand All @@ -15,6 +15,7 @@ ARG WEBSOCKIFY_VERSION="master"
ARG LANG_WHICH=en
ARG LANG_WHERE=US
ARG ENCODING=UTF-8
ARG LANGUAGE=${LANG_WHICH}_${LANG_WHERE}.${ENCODING}
ARG TARGETARCH

USER root
Expand All @@ -25,7 +26,7 @@ USER root
ENV LANG_WHICH=${LANG_WHICH} \
LANG_WHERE=${LANG_WHERE} \
ENCODING=${ENCODING} \
LANGUAGE=${LANG_WHICH}_${LANG_WHERE}.${ENCODING} \
LANGUAGE=${LANGUAGE} \
LANG=${LANGUAGE} \
#============================================
# Shared cleanup script environment variables
Expand Down
4 changes: 2 additions & 2 deletions NodeChrome/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
ARG NAMESPACE
ARG VERSION
ARG AUTHORS
FROM ${NAMESPACE}/node-base:${VERSION}
ARG AUTHORS
LABEL authors=${AUTHORS}

USER root
Expand Down Expand Up @@ -77,4 +77,4 @@ RUN echo "chrome" > /opt/selenium/browser_name
RUN google-chrome --version | awk '{print $3}' | cut -d'.' -f1,2 > /opt/selenium/browser_version
RUN echo "\"goog:chromeOptions\": {\"binary\": \"/usr/bin/google-chrome\"}" > /opt/selenium/browser_binary_location

ENV SE_OTEL_SERVICE_NAME "selenium-node-chrome"
ENV SE_OTEL_SERVICE_NAME="selenium-node-chrome"
4 changes: 2 additions & 2 deletions NodeChromium/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
ARG NAMESPACE
ARG VERSION
ARG AUTHORS
FROM ${NAMESPACE}/node-base:${VERSION}
ARG AUTHORS
LABEL authors=${AUTHORS}

USER root
Expand Down Expand Up @@ -41,4 +41,4 @@ RUN echo "chrome" > /opt/selenium/browser_name
RUN chromium --version | awk '{print $2}' | cut -d'.' -f1,2 > /opt/selenium/browser_version
RUN echo "\"goog:chromeOptions\": {\"binary\": \"/usr/bin/chromium\"}" > /opt/selenium/browser_binary_location

ENV SE_OTEL_SERVICE_NAME "selenium-node-chromium"
ENV SE_OTEL_SERVICE_NAME="selenium-node-chromium"
4 changes: 2 additions & 2 deletions NodeDocker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
ARG NAMESPACE
ARG VERSION
ARG AUTHORS
FROM ${NAMESPACE}/base:${VERSION}
ARG AUTHORS
LABEL authors=${AUTHORS}

USER root
Expand All @@ -28,4 +28,4 @@ COPY --chown="${SEL_UID}:${SEL_GID}" start-selenium-grid-docker.sh \

COPY selenium-grid-docker.conf /etc/supervisor/conf.d/

ENV SE_OTEL_SERVICE_NAME "selenium-node-docker"
ENV SE_OTEL_SERVICE_NAME="selenium-node-docker"
4 changes: 2 additions & 2 deletions NodeEdge/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
ARG NAMESPACE
ARG VERSION
ARG AUTHORS
FROM ${NAMESPACE}/node-base:${VERSION}
ARG AUTHORS
LABEL authors=${AUTHORS}

USER root
Expand Down Expand Up @@ -71,4 +71,4 @@ RUN echo "MicrosoftEdge" > /opt/selenium/browser_name
RUN microsoft-edge --version | awk '{print $3}' | cut -d'.' -f1,2 > /opt/selenium/browser_version
RUN echo "\"ms:edgeOptions\": {\"binary\": \"/usr/bin/microsoft-edge\"}" > /opt/selenium/browser_binary_location

ENV SE_OTEL_SERVICE_NAME "selenium-node-edge"
ENV SE_OTEL_SERVICE_NAME="selenium-node-edge"
4 changes: 2 additions & 2 deletions NodeFirefox/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
ARG NAMESPACE
ARG VERSION
ARG AUTHORS
FROM ${NAMESPACE}/node-base:${VERSION}
ARG AUTHORS
LABEL authors=${AUTHORS}

USER root
Expand Down Expand Up @@ -57,4 +57,4 @@ RUN echo "firefox" > /opt/selenium/browser_name
RUN firefox --version | awk '{print $3}' > /opt/selenium/browser_version
RUN echo "\"moz:firefoxOptions\": {\"binary\": \"/usr/bin/firefox\"}" > /opt/selenium/browser_binary_location

ENV SE_OTEL_SERVICE_NAME "selenium-node-firefox"
ENV SE_OTEL_SERVICE_NAME="selenium-node-firefox"
9 changes: 4 additions & 5 deletions Router/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
ARG NAMESPACE
ARG VERSION
ARG AUTHORS
FROM ${NAMESPACE}/base:${VERSION}
ARG AUTHORS
LABEL authors=${AUTHORS}

USER ${SEL_UID}
Expand All @@ -11,15 +11,14 @@ USER ${SEL_UID}
#========================

# In seconds, maps to "--session-request-timeout"
ENV SE_SESSION_REQUEST_TIMEOUT 300
ENV SE_SESSION_REQUEST_TIMEOUT=300 \
# In seconds, maps to "--session-retry-interval"
ENV SE_SESSION_RETRY_INTERVAL 5
SE_SESSION_RETRY_INTERVAL=5 \
SE_OTEL_SERVICE_NAME="selenium-router"

EXPOSE 4444

COPY --chown="${SEL_UID}:${SEL_GID}" start-selenium-grid-router.sh \
/opt/bin/

COPY selenium-grid-router.conf /etc/supervisor/conf.d/

ENV SE_OTEL_SERVICE_NAME "selenium-router"
9 changes: 4 additions & 5 deletions SessionQueue/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
ARG NAMESPACE
ARG VERSION
ARG AUTHORS
FROM ${NAMESPACE}/base:${VERSION}
ARG AUTHORS
LABEL authors=${AUTHORS}

USER ${SEL_UID}
Expand All @@ -11,15 +11,14 @@ USER ${SEL_UID}
#========================

# In seconds, maps to "--session-request-timeout"
ENV SE_SESSION_REQUEST_TIMEOUT 300
ENV SE_SESSION_REQUEST_TIMEOUT=300 \
# In seconds, maps to "--session-retry-interval"
ENV SE_SESSION_RETRY_INTERVAL 15
SE_SESSION_RETRY_INTERVAL=15 \
SE_OTEL_SERVICE_NAME="selenium-session-queue"

EXPOSE 5559

COPY --chown="${SEL_UID}:${SEL_GID}" start-selenium-grid-session-queue.sh \
/opt/bin/

COPY selenium-grid-session-queue.conf /etc/supervisor/conf.d/

ENV SE_OTEL_SERVICE_NAME "selenium-session-queue"
4 changes: 2 additions & 2 deletions Sessions/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
ARG NAMESPACE
ARG VERSION
ARG AUTHORS
FROM ${NAMESPACE}/base:${VERSION}
ARG AUTHORS
LABEL authors=${AUTHORS}

USER ${SEL_UID}
Expand All @@ -17,4 +17,4 @@ COPY --chown="${SEL_UID}:${SEL_GID}" start-selenium-grid-sessions.sh \

COPY selenium-grid-sessions.conf /etc/supervisor/conf.d/

ENV SE_OTEL_SERVICE_NAME "selenium-session-map"
ENV SE_OTEL_SERVICE_NAME="selenium-session-map"
13 changes: 6 additions & 7 deletions Standalone/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
ARG NAMESPACE
ARG VERSION
ARG AUTHORS
ARG BASE
FROM ${NAMESPACE}/${BASE}:${VERSION}
ARG AUTHORS
LABEL authors=${AUTHORS}

USER ${SEL_UID}
Expand All @@ -21,14 +21,13 @@ COPY selenium.conf /etc/supervisor/conf.d/
COPY --chown="${SEL_UID}:${SEL_GID}" generate_config /opt/bin/generate_config

# In seconds, maps to "--session-request-timeout"
ENV SE_SESSION_REQUEST_TIMEOUT 300
ENV SE_SESSION_REQUEST_TIMEOUT=300 \
# In seconds, maps to "--session-retry-interval"
ENV SE_SESSION_RETRY_INTERVAL 15
SE_SESSION_RETRY_INTERVAL=15 \
# In seconds, maps to "--healthcheck-interval"
ENV SE_HEALTHCHECK_INTERVAL 120
SE_HEALTHCHECK_INTERVAL=120 \
# Boolean value, maps "--relax-checks"
ENV SE_RELAX_CHECKS true
SE_RELAX_CHECKS=true \
SE_OTEL_SERVICE_NAME="selenium-standalone"

EXPOSE 4444

ENV SE_OTEL_SERVICE_NAME "selenium-standalone"
11 changes: 5 additions & 6 deletions StandaloneDocker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
ARG NAMESPACE
ARG VERSION
ARG AUTHORS
FROM ${NAMESPACE}/node-docker:${VERSION}
ARG AUTHORS
LABEL authors=${AUTHORS}

USER ${SEL_UID}
Expand All @@ -15,10 +15,9 @@ EXPOSE 4444
COPY --chown="${SEL_UID}:${SEL_GID}" start-selenium-grid-docker.sh /opt/bin/

# In seconds, maps to "--session-request-timeout"
ENV SE_SESSION_REQUEST_TIMEOUT 300
ENV SE_SESSION_REQUEST_TIMEOUT=300 \
# In seconds, maps to "--session-retry-interval"
ENV SE_SESSION_RETRY_INTERVAL 15
SE_SESSION_RETRY_INTERVAL=15 \
# Boolean value, maps "--relax-checks"
ENV SE_RELAX_CHECKS true

ENV SE_OTEL_SERVICE_NAME "selenium-standalone-docker"
SE_RELAX_CHECKS=true \
SE_OTEL_SERVICE_NAME="selenium-standalone-docker"
Loading
Loading