Skip to content

Commit

Permalink
try java 21
Browse files Browse the repository at this point in the history
  • Loading branch information
kamil-stc committed Feb 7, 2024
1 parent 98c5a48 commit 7858838
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 11 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/maven.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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/[email protected]
Expand Down
10 changes: 5 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
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
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"]
Expand Down
4 changes: 2 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<java.version>17</java.version>
<java.version>21</java.version>
<fabric8.version>6.8.1</fabric8.version>
</properties>

Expand Down Expand Up @@ -105,7 +105,7 @@
<artifactId>maven-compiler-plugin</artifactId>
<version>3.10.1</version>
<configuration>
<release>17</release>
<release>21</release>
<fork>true</fork>
<compilerArgument>-XDignore.symbol.file</compilerArgument>
</configuration>
Expand Down

0 comments on commit 7858838

Please sign in to comment.