Skip to content

Commit

Permalink
update: Java 17 and maven deps same as upstream Selenium
Browse files Browse the repository at this point in the history
Signed-off-by: Viet Nguyen Duc <nguyenducviet4496@gmail.com>
  • Loading branch information
VietND96 committed Mar 27, 2024
1 parent cb62829 commit 71266a4
Showing 1 changed file with 23 additions and 6 deletions.
29 changes: 23 additions & 6 deletions Base/Dockerfile
@@ -1,12 +1,12 @@
FROM ubuntu:jammy-20240227

This comment has been minimized.

Copy link
@diemol

diemol Apr 4, 2024

Member

Shouldn't we use a tag to know what base image we rely on? I guess renovate can help us keep this updated.

This comment has been minimized.

Copy link
@VietND96

VietND96 Apr 4, 2024

Author Member

Sure, I will add the tag back

FROM ubuntu:jammy
LABEL authors="Selenium <selenium-developers@googlegroups.com>"

# Arguments to define the version of dependencies to download
ARG VERSION
ARG RELEASE=selenium-${VERSION}
# Default value should be aligned with upstream Selenium (https://github.com/SeleniumHQ/selenium/blob/trunk/java/maven_deps.bzl)
ARG OPENTELEMETRY_VERSION=1.34.1
ARG GRPC_VERSION=1.61.0
ARG OPENTELEMETRY_VERSION=1.35.0
ARG GRPC_VERSION=1.61.1

#Arguments to define the user running Selenium
ARG SEL_USER=seluser
Expand All @@ -22,6 +22,8 @@ USER root
RUN echo "deb http://archive.ubuntu.com/ubuntu jammy main universe\n" > /etc/apt/sources.list \
&& echo "deb http://archive.ubuntu.com/ubuntu jammy-updates main universe\n" >> /etc/apt/sources.list \
&& echo "deb http://security.ubuntu.com/ubuntu jammy-security main universe\n" >> /etc/apt/sources.list
ARG TARGETARCH=amd64
ARG TARGETVARIANT

# No interactive frontend during docker build
ENV DEBIAN_FRONTEND=noninteractive \
Expand All @@ -31,13 +33,13 @@ ENV DEBIAN_FRONTEND=noninteractive \
# Miscellaneous packages
# Includes minimal runtime used for executing non GUI Java programs
#========================
ARG JRE_VERSION=17
RUN apt-get -qqy update \
&& apt-get upgrade -yq \
&& apt-get -qqy --no-install-recommends install \
acl \
bzip2 \
ca-certificates \
openjdk-11-jre-headless \
tzdata \
sudo \
unzip \
Expand All @@ -47,8 +49,23 @@ RUN apt-get -qqy update \
supervisor \
gnupg2 \
libnss3-tools \
&& rm -rf /var/lib/apt/lists/* /var/cache/apt/* \
&& sed -i 's/securerandom\.source=file:\/dev\/random/securerandom\.source=file:\/dev\/urandom/' ./usr/lib/jvm/java-11-openjdk-amd64/conf/security/java.security
&& mkdir -p /etc/apt/keyrings \
&& 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 \
&& rm -rf /var/lib/apt/lists/* /var/cache/apt/*

#===================

RUN if [ $TARGETARCH = "arm" ] && [ $TARGETVARIANT = "v7" ]; then \
export ARCH=armhf ; \
else \
export ARCH=$TARGETARCH ; \
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


#===================
# Timezone settings
Expand Down

2 comments on commit 71266a4

@VietND96
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@diemol, with the upgrade JRE 17 used in base image, do you think it is fine?

@diemol
Copy link
Member

@diemol diemol commented on 71266a4 Mar 27, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Java 17 is recommended for development, the minimum Java version is 11.
Having Java 17 in the images is fine.

Please sign in to comment.