Skip to content

Commit 396b281

Browse files
authored
Add java 21 (#1)
1 parent e20e824 commit 396b281

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

content/language/java/containerize.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ WARNING: The following Docker files already exist in this directory:
6363
? Do you want to overwrite them? Yes
6464
? What application platform does your project use? Java
6565
? What's the relative directory (with a leading .) for your app? ./src
66-
? What version of Java do you want to use? 17
66+
? What version of Java do you want to use? 21
6767
? What port does your server listen on? 8080
6868
```
6969

@@ -94,7 +94,7 @@ Create a file named `Dockerfile` with the following contents.
9494
################################################################################
9595

9696
# Create a stage for resolving and downloading dependencies.
97-
FROM eclipse-temurin:17-jdk-jammy as deps
97+
FROM eclipse-temurin:21-jre-jammy as deps
9898

9999
WORKDIR /build
100100

@@ -151,7 +151,7 @@ RUN java -Djarmode=layertools -jar target/app.jar extract --destination target/e
151151
# most recent version of that tag when you build your Dockerfile.
152152
# If reproducability is important, consider using a specific digest SHA, like
153153
# eclipse-temurin@sha256:99cede493dfd88720b610eb8077c8688d3cca50003d76d1d539b0efc8cca72b4.
154-
FROM eclipse-temurin:17-jre-jammy AS final
154+
FROM eclipse-temurin:21-jre-jammy AS final
155155

156156
# Create a non-privileged user that the app will run under.
157157
# See https://docs.docker.com/go/dockerfile-user-best-practices/

content/language/java/develop.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ Replace the contents of your Dockerfile with the following.
116116
```dockerfile {hl_lines="22-29"}
117117
# syntax=docker/dockerfile:1
118118
119-
FROM eclipse-temurin:17-jdk-jammy as deps
119+
FROM eclipse-temurin:21-jdk-jammy as deps
120120
WORKDIR /build
121121
COPY --chmod=0755 mvnw mvnw
122122
COPY .mvn/ .mvn/
@@ -144,7 +144,7 @@ RUN cp -r /build/target/extracted/application/. ./
144144
ENV JAVA_TOOL_OPTIONS -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=*:8000
145145
CMD [ "java", "-Dspring.profiles.active=postgres", "org.springframework.boot.loader.launch.JarLauncher" ]
146146
147-
FROM eclipse-temurin:17-jre-jammy AS final
147+
FROM eclipse-temurin:21-jre-jammy AS final
148148
ARG UID=10001
149149
RUN adduser \
150150
--disabled-password \

content/language/java/run-tests.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ Replace the contents of your Dockerfile with the following.
2020
```dockerfile {hl_lines="3-19"}
2121
# syntax=docker/dockerfile:1
2222

23-
FROM eclipse-temurin:17-jdk-jammy as base
23+
FROM eclipse-temurin:21-jre-jammy as base
2424
WORKDIR /build
2525
COPY --chmod=0755 mvnw mvnw
2626
COPY .mvn/ .mvn/
@@ -59,7 +59,7 @@ RUN cp -r /build/target/extracted/application/. ./
5959
ENV JAVA_TOOL_OPTIONS="-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=*:8000"
6060
CMD [ "java", "-Dspring.profiles.active=postgres", "org.springframework.boot.loader.launch.JarLauncher" ]
6161

62-
FROM eclipse-temurin:17-jre-jammy AS final
62+
FROM eclipse-temurin:21-jre-jammy AS final
6363
ARG UID=10001
6464
RUN adduser \
6565
--disabled-password \

0 commit comments

Comments
 (0)