Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions content/guides/java/containerize.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ WARNING: The following Docker files already exist in this directory:
? Do you want to overwrite them? Yes
? What application platform does your project use? Java
? What's the relative directory (with a leading .) for your app? ./src
? What version of Java do you want to use? 17
? What version of Java do you want to use? 21
? What port does your server listen on? 8080
```

Expand Down Expand Up @@ -98,7 +98,7 @@ Create a file named `Dockerfile` with the following contents.
################################################################################

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

WORKDIR /build

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

# Create a non-privileged user that the app will run under.
# See https://docs.docker.com/go/dockerfile-user-best-practices/
Expand Down
4 changes: 2 additions & 2 deletions content/guides/java/develop.md
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ Replace the contents of your Dockerfile with the following.
```dockerfile {hl_lines="22-29"}
# syntax=docker/dockerfile:1

FROM eclipse-temurin:17-jdk-jammy as deps
FROM eclipse-temurin:21-jdk-jammy as deps
WORKDIR /build
COPY --chmod=0755 mvnw mvnw
COPY .mvn/ .mvn/
Expand Down Expand Up @@ -149,7 +149,7 @@ RUN cp -r /build/target/extracted/application/. ./
ENV JAVA_TOOL_OPTIONS -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=*:8000
CMD [ "java", "-Dspring.profiles.active=postgres", "org.springframework.boot.loader.launch.JarLauncher" ]

FROM eclipse-temurin:17-jre-jammy AS final
FROM eclipse-temurin:21-jre-jammy AS final
ARG UID=10001
RUN adduser \
--disabled-password \
Expand Down
4 changes: 2 additions & 2 deletions content/guides/java/run-tests.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ Replace the contents of your Dockerfile with the following.
```dockerfile {hl_lines="3-19"}
# syntax=docker/dockerfile:1

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

FROM eclipse-temurin:17-jre-jammy AS final
FROM eclipse-temurin:21-jre-jammy AS final
ARG UID=10001
RUN adduser \
--disabled-password \
Expand Down
Loading