Skip to content

Commit 066ee10

Browse files
authored
fix: warning LegacyKeyValueFormat in Dockerfile (#2314)
Signed-off-by: Viet Nguyen Duc <[email protected]>
1 parent 6b2a015 commit 066ee10

File tree

16 files changed

+82
-90
lines changed

16 files changed

+82
-90
lines changed

Base/Dockerfile

Lines changed: 10 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,17 @@ LABEL authors="Selenium <[email protected]>"
55
ARG VERSION
66
ARG RELEASE=selenium-${VERSION}
77
ARG AUTHORS=SeleniumHQ
8-
# Default value should be aligned with upstream Selenium (https://github.com/SeleniumHQ/selenium/blob/trunk/java/maven_deps.bzl)
9-
ARG OPENTELEMETRY_VERSION=1.38.0
10-
ARG GRPC_VERSION=1.64.0
11-
ARG NETTY_VERSION=4.1.108.Final
8+
# Default value should be aligned with upstream Selenium (https://github.com/SeleniumHQ/selenium/blob/trunk/MODULE.bazel)
9+
ARG OPENTELEMETRY_VERSION=1.40.0
10+
ARG GRPC_VERSION=1.65.1
11+
ARG NETTY_VERSION=4.1.111.Final
1212
ARG CS_VERSION=2.1.10
1313

1414
#Arguments to define the user running Selenium
1515
ARG SEL_USER=seluser
1616
ARG SEL_GROUP=${SEL_USER}
1717
ARG SEL_PASSWD=secret
18+
ARG HOME=/home/${SEL_USER}
1819
ARG UID=1200
1920
ARG GID=1201
2021
ARG TZ="UTC"
@@ -30,7 +31,7 @@ ENV DEBIAN_FRONTEND=noninteractive \
3031
SEL_USER=${SEL_USER} \
3132
SEL_UID=${UID} \
3233
SEL_GID=${GID} \
33-
HOME=/home/${SEL_USER} \
34+
HOME=${HOME} \
3435
TZ=${TZ} \
3536
SEL_DOWNLOAD_DIR=${HOME}/Downloads
3637

@@ -58,18 +59,13 @@ RUN if [ "$(dpkg --print-architecture)" = "amd64" ]; then \
5859
supervisor \
5960
gnupg2 \
6061
libnss3-tools \
61-
&& mkdir -p /etc/apt/keyrings \
62-
&& apt-key adv --keyserver hkps://keyserver.ubuntu.com:443 --recv-keys 843C48A565F8F04B || apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 843C48A565F8F04B \
63-
&& wget -qO - https://packages.adoptium.net/artifactory/api/gpg/key/public | tee /etc/apt/keyrings/adoptium.asc >dev/null \
64-
&& 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 \
65-
&& apt-get -qqy update \
66-
&& apt-get -qqy --no-install-recommends install temurin-${JRE_VERSION}-jre -y \
62+
openjdk-${JRE_VERSION}-jre-headless \
6763
&& if [ "${TARGETARCH}" = "arm" ] && [ "${TARGETVARIANT}" = "v7" ]; then \
6864
export ARCH=armhf ; \
6965
else \
7066
export ARCH=$(dpkg --print-architecture) ; \
7167
fi \
72-
&& 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 \
68+
&& 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 \
7369
&& rm -rf /var/lib/apt/lists/* /var/cache/apt/* \
7470
#===================
7571
# Timezone settings
@@ -95,9 +91,9 @@ RUN if [ "$(dpkg --print-architecture)" = "amd64" ]; then \
9591
# Selenium & relaxing permissions for OpenShift and other non-sudo environments
9692
#==========
9793
&& mkdir -p /opt/selenium /opt/selenium/assets /var/run/supervisor /var/log/supervisor ${SEL_DOWNLOAD_DIR} \
98-
${HOME}/.mozilla ${HOME}/.vnc $HOME/.pki/nssdb \
94+
${HOME}/.mozilla ${HOME}/.vnc ${HOME}/.pki/nssdb \
9995
# NSSDB initialization with an empty password
100-
&& certutil -d sql:$HOME/.pki/nssdb -N --empty-password \
96+
&& certutil -d sql:${HOME}/.pki/nssdb -N --empty-password \
10197
&& touch /opt/selenium/config.toml \
10298
&& chown -R ${SEL_USER}:${SEL_GROUP} /opt/selenium /var/run/supervisor /var/log/supervisor /etc/passwd ${HOME} \
10399
&& chmod -R 775 /opt/selenium /var/run/supervisor /var/log/supervisor /etc/passwd ${HOME} \

Distributor/Dockerfile

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
ARG NAMESPACE
22
ARG VERSION
3-
ARG AUTHORS
43
FROM ${NAMESPACE}/base:${VERSION}
4+
ARG AUTHORS
55
LABEL authors=${AUTHORS}
66

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

2020
# In seconds, maps to "--session-request-timeout"
21-
ENV SE_SESSION_REQUEST_TIMEOUT 300
21+
ENV SE_SESSION_REQUEST_TIMEOUT=300 \
2222
# In seconds, maps to "--session-retry-interval"
23-
ENV SE_SESSION_RETRY_INTERVAL 15
23+
SE_SESSION_RETRY_INTERVAL=15 \
2424
# In seconds, maps to "--healthcheck-interval"
25-
ENV SE_HEALTHCHECK_INTERVAL 120
26-
27-
ENV SE_OTEL_SERVICE_NAME "selenium-distributor"
25+
SE_HEALTHCHECK_INTERVAL=120 \
26+
SE_OTEL_SERVICE_NAME="selenium-distributor"

EventBus/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
ARG NAMESPACE
22
ARG VERSION
3-
ARG AUTHORS
43
FROM ${NAMESPACE}/base:${VERSION}
4+
ARG AUTHORS
55
LABEL authors=${AUTHORS}
66

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

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

25-
ENV SE_OTEL_SERVICE_NAME "selenium-event-bus"
25+
ENV SE_OTEL_SERVICE_NAME="selenium-event-bus"

Hub/Dockerfile

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
ARG NAMESPACE
22
ARG VERSION
3-
ARG AUTHORS
43
FROM ${NAMESPACE}/base:${VERSION}
4+
ARG AUTHORS
55
LABEL authors=${AUTHORS}
66

77
USER ${SEL_UID}
@@ -15,17 +15,16 @@ EXPOSE 4443
1515
EXPOSE 4444
1616

1717
# In seconds, maps to "--session-request-timeout"
18-
ENV SE_SESSION_REQUEST_TIMEOUT 300
18+
ENV SE_SESSION_REQUEST_TIMEOUT=300 \
1919
# In seconds, maps to "--session-retry-interval"
20-
ENV SE_SESSION_RETRY_INTERVAL 15
20+
SE_SESSION_RETRY_INTERVAL=15 \
2121
# In seconds, maps to "--healthcheck-interval"
22-
ENV SE_HEALTHCHECK_INTERVAL 120
22+
SE_HEALTHCHECK_INTERVAL=120 \
2323
# Boolean value, maps "--relax-checks"
24-
ENV SE_RELAX_CHECKS true
24+
SE_RELAX_CHECKS=true \
25+
SE_OTEL_SERVICE_NAME="selenium-hub"
2526

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

2930
COPY selenium-grid-hub.conf /etc/supervisor/conf.d/
30-
31-
ENV SE_OTEL_SERVICE_NAME "selenium-hub"

NodeBase/Dockerfile

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
ARG NAMESPACE
22
ARG VERSION
3-
ARG AUTHORS
43
FROM ${NAMESPACE}/base:${VERSION}
4+
ARG AUTHORS
55
LABEL authors=${AUTHORS}
66

77
# Inputs: heads, tags
@@ -15,6 +15,7 @@ ARG WEBSOCKIFY_VERSION="master"
1515
ARG LANG_WHICH=en
1616
ARG LANG_WHERE=US
1717
ARG ENCODING=UTF-8
18+
ARG LANGUAGE=${LANG_WHICH}_${LANG_WHERE}.${ENCODING}
1819
ARG TARGETARCH
1920

2021
USER root
@@ -25,7 +26,7 @@ USER root
2526
ENV LANG_WHICH=${LANG_WHICH} \
2627
LANG_WHERE=${LANG_WHERE} \
2728
ENCODING=${ENCODING} \
28-
LANGUAGE=${LANG_WHICH}_${LANG_WHERE}.${ENCODING} \
29+
LANGUAGE=${LANGUAGE} \
2930
LANG=${LANGUAGE} \
3031
#============================================
3132
# Shared cleanup script environment variables

NodeChrome/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
ARG NAMESPACE
22
ARG VERSION
3-
ARG AUTHORS
43
FROM ${NAMESPACE}/node-base:${VERSION}
4+
ARG AUTHORS
55
LABEL authors=${AUTHORS}
66

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

80-
ENV SE_OTEL_SERVICE_NAME "selenium-node-chrome"
80+
ENV SE_OTEL_SERVICE_NAME="selenium-node-chrome"

NodeChromium/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
ARG NAMESPACE
22
ARG VERSION
3-
ARG AUTHORS
43
FROM ${NAMESPACE}/node-base:${VERSION}
4+
ARG AUTHORS
55
LABEL authors=${AUTHORS}
66

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

44-
ENV SE_OTEL_SERVICE_NAME "selenium-node-chromium"
44+
ENV SE_OTEL_SERVICE_NAME="selenium-node-chromium"

NodeDocker/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
ARG NAMESPACE
22
ARG VERSION
3-
ARG AUTHORS
43
FROM ${NAMESPACE}/base:${VERSION}
4+
ARG AUTHORS
55
LABEL authors=${AUTHORS}
66

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

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

31-
ENV SE_OTEL_SERVICE_NAME "selenium-node-docker"
31+
ENV SE_OTEL_SERVICE_NAME="selenium-node-docker"

NodeEdge/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
ARG NAMESPACE
22
ARG VERSION
3-
ARG AUTHORS
43
FROM ${NAMESPACE}/node-base:${VERSION}
4+
ARG AUTHORS
55
LABEL authors=${AUTHORS}
66

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

74-
ENV SE_OTEL_SERVICE_NAME "selenium-node-edge"
74+
ENV SE_OTEL_SERVICE_NAME="selenium-node-edge"

NodeFirefox/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
ARG NAMESPACE
22
ARG VERSION
3-
ARG AUTHORS
43
FROM ${NAMESPACE}/node-base:${VERSION}
4+
ARG AUTHORS
55
LABEL authors=${AUTHORS}
66

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

60-
ENV SE_OTEL_SERVICE_NAME "selenium-node-firefox"
60+
ENV SE_OTEL_SERVICE_NAME="selenium-node-firefox"

0 commit comments

Comments
 (0)