mirror of https://github.com/docker/docs.git
commit
7e152bb44f
|
@ -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
|
||||
```
|
||||
|
||||
|
@ -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
|
||||
|
||||
|
@ -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 reproducibility 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/
|
||||
|
|
|
@ -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/
|
||||
|
@ -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 \
|
||||
|
|
|
@ -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/
|
||||
|
@ -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 \
|
||||
|
|
Loading…
Reference in New Issue