diff --git a/docs/serving/samples/hello-world/helloworld-java/.dockerignore b/docs/serving/samples/hello-world/helloworld-java/.dockerignore new file mode 100644 index 000000000..2f7896d1d --- /dev/null +++ b/docs/serving/samples/hello-world/helloworld-java/.dockerignore @@ -0,0 +1 @@ +target/ diff --git a/docs/serving/samples/hello-world/helloworld-java/Dockerfile b/docs/serving/samples/hello-world/helloworld-java/Dockerfile index 8cecd4f7d..59099b3ab 100644 --- a/docs/serving/samples/hello-world/helloworld-java/Dockerfile +++ b/docs/serving/samples/hello-world/helloworld-java/Dockerfile @@ -10,10 +10,11 @@ COPY src ./src # Build a release artifact. RUN mvn package -DskipTests -# Use the Official OpenJDK image for a lean production stage of our multi-stage build. -# https://hub.docker.com/_/openjdk +# Use AdoptOpenJDK for base image. +# It's important to use OpenJDK 8u191 or above that has container support enabled. +# https://hub.docker.com/r/adoptopenjdk/openjdk8 # https://docs.docker.com/develop/develop-images/multistage-build/#use-multi-stage-builds -FROM openjdk:8-jre-alpine +FROM adoptopenjdk/openjdk8:jdk8u202-b08-alpine-slim # Copy the jar to the production image from the builder stage. COPY --from=builder /app/target/helloworld-*.jar /helloworld.jar diff --git a/docs/serving/samples/hello-world/helloworld-java/README.md b/docs/serving/samples/hello-world/helloworld-java/README.md index b6483622a..6f43b20c1 100644 --- a/docs/serving/samples/hello-world/helloworld-java/README.md +++ b/docs/serving/samples/hello-world/helloworld-java/README.md @@ -97,10 +97,11 @@ recreate the source files from this folder. # Build a release artifact. RUN mvn package -DskipTests - # Use the Official OpenJDK image for a lean production stage of our multi-stage build. - # https://hub.docker.com/_/openjdk + # Use AdoptOpenJDK for base image. + # It's important to use OpenJDK 8u191 or above that has container support enabled. + # https://hub.docker.com/r/adoptopenjdk/openjdk8 # https://docs.docker.com/develop/develop-images/multistage-build/#use-multi-stage-builds - FROM openjdk:8-jre-alpine + FROM adoptopenjdk/openjdk8:jdk8u202-b08-alpine-slim # Copy the jar to the production image from the builder stage. COPY --from=builder /app/target/helloworld-*.jar /helloworld.jar diff --git a/docs/serving/samples/hello-world/helloworld-java/pom.xml b/docs/serving/samples/hello-world/helloworld-java/pom.xml index 354ed7d52..8f6c44208 100644 --- a/docs/serving/samples/hello-world/helloworld-java/pom.xml +++ b/docs/serving/samples/hello-world/helloworld-java/pom.xml @@ -14,7 +14,7 @@ org.springframework.boot spring-boot-starter-parent - 2.0.3.RELEASE + 2.1.3.RELEASE diff --git a/docs/serving/samples/hello-world/helloworld-kotlin/Dockerfile b/docs/serving/samples/hello-world/helloworld-kotlin/Dockerfile index 6cb717365..18d4f11fb 100644 --- a/docs/serving/samples/hello-world/helloworld-kotlin/Dockerfile +++ b/docs/serving/samples/hello-world/helloworld-kotlin/Dockerfile @@ -9,10 +9,11 @@ COPY src ./src # Build a release artifact. RUN gradle clean build --no-daemon -# Use the Official OpenJDK image for a lean production stage of our multi-stage build. -# https://hub.docker.com/_/openjdk +# Use AdoptOpenJDK for base image. +# It's important to use OpenJDK 8u191 or above that has container support enabled. +# https://hub.docker.com/r/adoptopenjdk/openjdk8 # https://docs.docker.com/develop/develop-images/multistage-build/#use-multi-stage-builds -FROM openjdk:8-jre-alpine +FROM adoptopenjdk/openjdk8:jdk8u202-b08-alpine-slim # Copy the jar to the production image from the builder stage. COPY --from=builder /home/gradle/build/libs/gradle.jar /helloworld.jar diff --git a/docs/serving/samples/hello-world/helloworld-kotlin/README.md b/docs/serving/samples/hello-world/helloworld-kotlin/README.md index a80671714..7bf1f0166 100644 --- a/docs/serving/samples/hello-world/helloworld-kotlin/README.md +++ b/docs/serving/samples/hello-world/helloworld-kotlin/README.md @@ -118,10 +118,11 @@ recreate the source files from this folder. # Build a release artifact. RUN gradle clean build --no-daemon - # Use the Official OpenJDK image for a lean production stage of our multi-stage build. - # https://hub.docker.com/_/openjdk + # Use AdoptOpenJDK for base image. + # It's important to use OpenJDK 8u191 or above that has container support enabled. + # https://hub.docker.com/r/adoptopenjdk/openjdk8 # https://docs.docker.com/develop/develop-images/multistage-build/#use-multi-stage-builds - FROM openjdk:8-jre-alpine + FROM adoptopenjdk/openjdk8:jdk8u202-b08-alpine-slim # Copy the jar to the production image from the builder stage. COPY --from=builder /home/gradle/build/libs/gradle.jar /helloworld.jar