From b8eb5b1e026926ddd6a03d66151bf5042cb78c45 Mon Sep 17 00:00:00 2001 From: Oliver Lehmann-Korn Date: Wed, 9 Oct 2024 14:16:22 +0200 Subject: [PATCH] Add Temurin 23 Images --- .github/workflows/temurin-23.yml | 28 ++++++++++++++++++++++++++++ README.md | 5 +++++ temurin/23/.env | 1 + temurin/23/Dockerfile | 30 ++++++++++++++++++++++++++++++ temurin/23/run.sh | 19 +++++++++++++++++++ 5 files changed, 83 insertions(+) create mode 100644 .github/workflows/temurin-23.yml create mode 100644 temurin/23/.env create mode 100644 temurin/23/Dockerfile create mode 100644 temurin/23/run.sh diff --git a/.github/workflows/temurin-23.yml b/.github/workflows/temurin-23.yml new file mode 100644 index 0000000..36546f0 --- /dev/null +++ b/.github/workflows/temurin-23.yml @@ -0,0 +1,28 @@ +name: Temurin 23 + +on: + workflow_dispatch: + schedule: + - cron: '21 21 * * *' + push: + branches: + - 'main' + +jobs: + build-and-push-jre: + uses: ./.github/workflows/workflow-docker-build.yml + with: + jvm-type: jre + docker-context: temurin/23 + permissions: + contents: read + packages: write + + build-and-push-jdk: + uses: ./.github/workflows/workflow-docker-build.yml + with: + jvm-type: jdk + docker-context: temurin/23 + permissions: + contents: read + packages: write diff --git a/README.md b/README.md index 6eb53a5..ccf4afc 100644 --- a/README.md +++ b/README.md @@ -69,6 +69,11 @@ COPY --chown=formcentric:formcentric my-application.jar /formcentric/app.jar Formcentric base images build upon the official [Adoptium](https://adoptium.net) images of the Eclipse Temurin distribution (OpenJDK) and come in the following flavors: +### Java 23 (Until 18 Mar 2025) + +- `ghcr.io/formcentric/java-base:23-jre` +- `ghcr.io/formcentric/java-base:23-jdk` + ### Java 21 - `ghcr.io/formcentric/java-base:21-jre` diff --git a/temurin/23/.env b/temurin/23/.env new file mode 100644 index 0000000..dee84ab --- /dev/null +++ b/temurin/23/.env @@ -0,0 +1 @@ +JAVA_VERSION=23_37 diff --git a/temurin/23/Dockerfile b/temurin/23/Dockerfile new file mode 100644 index 0000000..0b3773d --- /dev/null +++ b/temurin/23/Dockerfile @@ -0,0 +1,30 @@ +ARG JVM_TYPE=jre +ARG JAVA_VERSION=23_37 +ARG TEMURIN_VERSION=${JAVA_VERSION}-${JVM_TYPE}-noble +FROM eclipse-temurin:${TEMURIN_VERSION} + +RUN userdel -r ubuntu + +RUN apt-get update && \ + apt-get upgrade -y && \ + apt-get install -y --no-install-recommends \ + ca-certificates \ + curl \ + wget \ + coreutils \ + fontconfig \ + fonts-dejavu && \ + apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* && \ + groupadd -g 1000 formcentric && \ + useradd -u 1000 -d /formcentric -g formcentric formcentric + +USER formcentric:formcentric + +WORKDIR /formcentric + +COPY --chown=formcentric:formcentric run.sh . +RUN chmod +x run.sh + +COPY --chown=formcentric:formcentric app.jar app.jar + +ENTRYPOINT ["./run.sh"] diff --git a/temurin/23/run.sh b/temurin/23/run.sh new file mode 100644 index 0000000..9a5374d --- /dev/null +++ b/temurin/23/run.sh @@ -0,0 +1,19 @@ +#!/bin/sh +set -e + +if [ -n "${EXTRA_JAVA_OPTS}" ]; then + JAVA_OPTS="$JAVA_OPTS $EXTRA_JAVA_OPTS" +fi + +JAVA_CMD_ARGS="-XX:-UsePerfData \ + ${JAVA_OPTS} \ + -XX:+UseContainerSupport \ + -Djava.security.egd=file:/dev/./urandom" + +if [ -f jib-classpath-file -a -f jib-main-class-file ]; then + exec java $JAVA_CMD_ARGS -cp @jib-classpath-file @jib-main-class-file ${@} +elif [ -f BOOT-INF/layers.idx ]; then + exec java $JAVA_CMD_ARGS ${SPRING_BOOT_EXPLODED_MAINCLASS:-org.springframework.boot.loader.launch.JarLauncher} ${@} +else + exec java $JAVA_CMD_ARGS -jar app.jar ${@} +fi