Skip to content

Commit

Permalink
bumped Dockerfiles to Java 21
Browse files Browse the repository at this point in the history
  • Loading branch information
maeddes committed Jan 2, 2025
1 parent a61bf86 commit 5c9e446
Show file tree
Hide file tree
Showing 11 changed files with 31 additions and 19 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#Thu Jan 02 20:40:38 UTC 2025
distributionBase=GRADLE_USER_HOME
distributionUrl=https\://services.gradle.org/distributions/gradle-8.9-bin.zip
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4.2-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
11 changes: 11 additions & 0 deletions java/.settings/org.eclipse.jdt.core.prefs
Original file line number Diff line number Diff line change
@@ -1,10 +1,21 @@
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.annotation.missingNonNullByDefaultAnnotation=ignore
org.eclipse.jdt.core.compiler.annotation.nonnull=org.springframework.lang.NonNull
org.eclipse.jdt.core.compiler.annotation.nonnullbydefault=org.springframework.lang.NonNullApi
org.eclipse.jdt.core.compiler.annotation.nullable=org.springframework.lang.Nullable
org.eclipse.jdt.core.compiler.annotation.nullanalysis=enabled
org.eclipse.jdt.core.compiler.codegen.methodParameters=generate
org.eclipse.jdt.core.compiler.codegen.targetPlatform=17
org.eclipse.jdt.core.compiler.compliance=17
org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled
org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
org.eclipse.jdt.core.compiler.problem.nullAnnotationInferenceConflict=warning
org.eclipse.jdt.core.compiler.problem.nullReference=warning
org.eclipse.jdt.core.compiler.problem.nullSpecViolation=warning
org.eclipse.jdt.core.compiler.problem.nullUncheckedConversion=ignore
org.eclipse.jdt.core.compiler.problem.potentialNullReference=warning
org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=ignore
org.eclipse.jdt.core.compiler.problem.syntacticNullAnalysisForFields=enabled
org.eclipse.jdt.core.compiler.processAnnotations=disabled
org.eclipse.jdt.core.compiler.release=enabled
org.eclipse.jdt.core.compiler.source=17
4 changes: 2 additions & 2 deletions java/Dockerfile-multistage-builder
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
FROM maven:3-eclipse-temurin-17 AS build
FROM maven:3-eclipse-temurin-21 AS build
RUN mkdir -p /opt/app/src
COPY src /opt/app/src
COPY pom.xml /opt/app
RUN mvn -f /opt/app/pom.xml clean package

FROM eclipse-temurin:17-jre
FROM eclipse-temurin:21-jre
RUN mkdir -p /opt/app
COPY --from=build /opt/app/target/simplecode-0.0.1-SNAPSHOT.jar /opt/app/simplecode-0.0.1-SNAPSHOT.jar
ENTRYPOINT ["java","-jar","/opt/app/simplecode-0.0.1-SNAPSHOT.jar"]
Expand Down
4 changes: 2 additions & 2 deletions java/Dockerfile-multistage-cache
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
FROM maven:3-eclipse-temurin-17 AS build
FROM maven:3-eclipse-temurin-21 AS build
RUN mkdir -p /opt/app/src
COPY src /opt/app/src
COPY pom.xml /opt/app
RUN --mount=type=cache,target=/root/.m2 mvn -f /opt/app/pom.xml clean package

FROM eclipse-temurin:17-jre
FROM eclipse-temurin:21-jre
RUN mkdir -p /opt/app
COPY --from=build /opt/app/target/simplecode-0.0.1-SNAPSHOT.jar /opt/app.jar
CMD ["java","-jar","/opt/app.jar"]
2 changes: 1 addition & 1 deletion java/Dockerfile-simple-ibm-semeru
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
FROM ibm-semeru-runtimes:open-17-jre
FROM ibm-semeru-runtimes:open-21-jre
COPY target/simplecode-0.0.1-SNAPSHOT.jar /opt/app.jar
CMD ["java", "-jar", "/opt/app.jar"]
2 changes: 1 addition & 1 deletion java/Dockerfile-simple-temurin
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
FROM eclipse-temurin:17-jre
FROM eclipse-temurin:21-jre
COPY target/simplecode-0.0.1-SNAPSHOT.jar /opt/app.jar
CMD ["java", "-jar", "/opt/app.jar"]
2 changes: 1 addition & 1 deletion java/Dockerfile-simple-temurin-JVMflags
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
FROM eclipse-temurin:17-jre
FROM eclipse-temurin:21-jre
COPY target/simplecode-0.0.1-SNAPSHOT.jar /opt/app.jar
CMD ["java","-XX:+UseParallelGC","-XX:MaxRAMPercentage=75","-jar", "/opt/app.jar"]
2 changes: 1 addition & 1 deletion java/Dockerfile-simple-temurinjre
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
FROM eclipse-temurin:17-jre
FROM eclipse-temurin:21-jre
COPY target/simplecode-0.0.1-SNAPSHOT.jar /opt/app.jar
CMD ["java", "-jar", "/opt/app.jar"]
4 changes: 2 additions & 2 deletions java/Dockerfile-simple-ubuntu
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
FROM ubuntu:22.04
RUN apt update && apt install openjdk-17-jre-headless -y
FROM ubuntu:latest
RUN apt update && apt install openjdk-21-jre-headless -y
COPY target/simplecode-0.0.1-SNAPSHOT.jar /opt/app.jar
CMD ["java","-jar","/opt/app.jar"]

8 changes: 4 additions & 4 deletions java/gradlex/.settings/org.eclipse.buildship.core.prefs
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
arguments=--init-script /workspace/.vscode-remote/data/User/globalStorage/redhat.java/1.18.0/config_linux/org.eclipse.osgi/51/0/.cp/gradle/init/init.gradle --init-script /workspace/.vscode-remote/data/User/globalStorage/redhat.java/1.18.0/config_linux/org.eclipse.osgi/51/0/.cp/gradle/protobuf/init.gradle
arguments=--init-script /home/vscode/.vscode-server/data/User/globalStorage/redhat.java/1.38.0/config_linux/org.eclipse.osgi/58/0/.cp/gradle/init/init.gradle --init-script /home/vscode/.vscode-server/data/User/globalStorage/redhat.java/1.38.0/config_linux/org.eclipse.osgi/58/0/.cp/gradle/protobuf/init.gradle
auto.sync=true
build.scans.enabled=false
connection.gradle.distribution=GRADLE_DISTRIBUTION(LOCAL_INSTALLATION(/home/gitpod/.sdkman/candidates/gradle/current))
connection.gradle.distribution=GRADLE_DISTRIBUTION(WRAPPER)
connection.project.dir=
eclipse.preferences.version=1
gradle.user.home=/workspace/.gradle
java.home=/home/gitpod/.sdkman/candidates/java/17.0.7.fx-zulu
gradle.user.home=
java.home=/usr/local/sdkman/candidates/java/current
jvm.arguments=
offline.mode=false
override.workspace.settings=true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,15 @@ private String getHostname(){
}

@GetMapping("/")
String hello(){
String helloABCAB(){

logger.info("Call to hello method on instance: " + getHostname());
logger.info("Call to helloABC method on instance: " + getHostname());
return getHostname()+" Hello, Container people ! ";

}

@GetMapping("/fail")
String fail() {
String failABC() {

logger.info("Call to failing method on instance: "+getHostname());
System.exit(1);
Expand Down

0 comments on commit 5c9e446

Please sign in to comment.