From 7858838972b4259b41483719244a730d513e6f87 Mon Sep 17 00:00:00 2001 From: Kamil Krzywicki Date: Wed, 7 Feb 2024 14:53:17 +0100 Subject: [PATCH] try java 21 --- .github/workflows/codeql-analysis.yml | 4 ++-- .github/workflows/maven.yaml | 4 ++-- Dockerfile | 10 +++++----- pom.xml | 4 ++-- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index ea2495f..2c17c84 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -40,11 +40,11 @@ jobs: - name: Checkout repository uses: actions/checkout@v2 - - name: Set up JDK 17 + - name: Set up JDK 21 uses: actions/setup-java@v3 with: distribution: 'zulu' - java-version: 17 + java-version: 21 cache: 'maven' # Initializes the CodeQL tools for scanning. diff --git a/.github/workflows/maven.yaml b/.github/workflows/maven.yaml index db01a18..4547795 100644 --- a/.github/workflows/maven.yaml +++ b/.github/workflows/maven.yaml @@ -19,11 +19,11 @@ jobs: steps: - uses: actions/checkout@v3 - - name: Set up JDK 17 + - name: Set up JDK 21 uses: actions/setup-java@v3 with: distribution: 'zulu' - java-version: 17 + java-version: 21 cache: 'maven' - uses: helm/kind-action@v1.5.0 diff --git a/Dockerfile b/Dockerfile index 9a4ded0..c87c55a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,5 @@ -FROM gcr.io/distroless/java17:nonroot AS SECURITY -FROM openjdk:17 AS BUILD +FROM --platform=$BUILDPLATFORM gcr.io/distroless/java21:nonroot AS SECURITY +FROM --platform=$BUILDPLATFORM openjdk:21 AS BUILD COPY . /opt WORKDIR /opt @@ -7,14 +7,14 @@ RUN ./mvnw clean install -DskipTests ENV JAVA_RANDOM="file:/dev/./urandom" -COPY --from=SECURITY /etc/java-17-openjdk/security/java.security /java.security +COPY --from=SECURITY /etc/java-21-openjdk/security/java.security /java.security RUN echo "networkaddress.cache.ttl=60" >> /java.security RUN sed -i -e "s@^securerandom.source=.*@securerandom.source=${JAVA_RANDOM}@" /java.security -FROM --platform=$BUILDPLATFORM gcr.io/distroless/java17:nonroot +FROM --platform=$BUILDPLATFORM gcr.io/distroless/java21:nonroot COPY --from=BUILD /opt/target/vault-crd.jar /opt/vault-crd.jar -COPY --from=BUILD /java.security /etc/java-17-openjdk/security/java.security +COPY --from=BUILD /java.security /etc/java-21-openjdk/security/java.security ENTRYPOINT ["/usr/bin/java", "-Djavax.net.ssl.trustStore=/etc/ssl/certs/java/cacerts", "-Djavax.net.ssl.trustStorePassword=changeit", "-Djavax.net.ssl.trustStoreType=jks", "-Dkeystore.pkcs12.legacy"] CMD ["-jar", "/opt/vault-crd.jar"] diff --git a/pom.xml b/pom.xml index d3f6edc..18ca27f 100644 --- a/pom.xml +++ b/pom.xml @@ -21,7 +21,7 @@ UTF-8 UTF-8 - 17 + 21 6.8.1 @@ -105,7 +105,7 @@ maven-compiler-plugin 3.10.1 - 17 + 21 true -XDignore.symbol.file