diff --git a/.github/workflows/github-actions-micronaut-webserver.yml b/.github/workflows/github-actions-micronaut-webserver.yml index e5e1f7a..2147845 100644 --- a/.github/workflows/github-actions-micronaut-webserver.yml +++ b/.github/workflows/github-actions-micronaut-webserver.yml @@ -14,7 +14,7 @@ jobs: - name: Set up GraalVM uses: graalvm/setup-graalvm@v1 with: - java-version: '24' + java-version: '25' distribution: 'graalvm' github-token: ${{ secrets.GITHUB_TOKEN }} - name: Run Micronaut Web Server diff --git a/.github/workflows/github-actions-native-image-build-tools-maven.yml b/.github/workflows/github-actions-native-image-build-tools-maven.yml index b0a5e9b..5d32c26 100644 --- a/.github/workflows/github-actions-native-image-build-tools-maven.yml +++ b/.github/workflows/github-actions-native-image-build-tools-maven.yml @@ -16,7 +16,7 @@ jobs: - name: Set up GraalVM uses: graalvm/setup-graalvm@v1 with: - java-version: '24' + java-version: '25' distribution: 'graalvm' github-token: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/github-actions-native-image-containerisation.yml b/.github/workflows/github-actions-native-image-containerisation.yml index 18f2da1..3e95cce 100644 --- a/.github/workflows/github-actions-native-image-containerisation.yml +++ b/.github/workflows/github-actions-native-image-containerisation.yml @@ -15,7 +15,7 @@ jobs: - uses: graalvm/setup-graalvm@v1 with: - java-version: '24' + java-version: '25' distribution: 'graalvm' github-token: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/github-actions-native-image-quickstart.yml b/.github/workflows/github-actions-native-image-quickstart.yml index 8e0da45..7709937 100644 --- a/.github/workflows/github-actions-native-image-quickstart.yml +++ b/.github/workflows/github-actions-native-image-quickstart.yml @@ -16,7 +16,7 @@ jobs: - uses: graalvm/setup-graalvm@v1 with: - java-version: '24' + java-version: '25' distribution: 'graalvm' github-token: ${{ secrets.GITHUB_TOKEN }} - name: Build and Test Java Code diff --git a/.github/workflows/github-actions-native-image-reflection.yml b/.github/workflows/github-actions-native-image-reflection.yml index b23986a..4c8bf7f 100644 --- a/.github/workflows/github-actions-native-image-reflection.yml +++ b/.github/workflows/github-actions-native-image-reflection.yml @@ -16,7 +16,7 @@ jobs: - name: Set up GraalVM uses: graalvm/setup-graalvm@v1 with: - java-version: '24' + java-version: '25' distribution: 'graalvm' github-token: ${{ secrets.GITHUB_TOKEN }} - name: Build and run diff --git a/.github/workflows/github-actions-spring-boot-webserver.yml b/.github/workflows/github-actions-spring-boot-webserver.yml index edeaed9..a76b272 100644 --- a/.github/workflows/github-actions-spring-boot-webserver.yml +++ b/.github/workflows/github-actions-spring-boot-webserver.yml @@ -14,7 +14,7 @@ jobs: - name: Set up GraalVM uses: graalvm/setup-graalvm@v1 with: - java-version: '24' + java-version: '25' distribution: 'graalvm' github-token: ${{ secrets.GITHUB_TOKEN }} - name: Run Spring Boot Web Server diff --git a/.github/workflows/github-actions-what-the-dickens.yml b/.github/workflows/github-actions-what-the-dickens.yml index 350bf0e..889c08c 100644 --- a/.github/workflows/github-actions-what-the-dickens.yml +++ b/.github/workflows/github-actions-what-the-dickens.yml @@ -14,7 +14,7 @@ jobs: - name: Set up GraalVM uses: graalvm/setup-graalvm@v1 with: - java-version: '24' + java-version: '25' distribution: 'graalvm' github-token: ${{ secrets.GITHUB_TOKEN }} - name: Build and Test Java Code diff --git a/native-image/containerisation/README.md b/native-image/containerisation/README.md index d8cbb6f..f5423d3 100644 --- a/native-image/containerisation/README.md +++ b/native-image/containerisation/README.md @@ -37,9 +37,9 @@ In this workshop you will: Before starting this workshop, you must have installed: -* [GraalVM for JDK 24](https://www.graalvm.org/downloads/). We recommend using [SDKMAN!](https://sdkman.io/). (For other download options, see [GraalVM Downloads](https://www.graalvm.org/downloads/).) +* [GraalVM 25](https://www.graalvm.org/downloads/). We recommend using [SDKMAN!](https://sdkman.io/). (For other download options, see [GraalVM Downloads](https://www.graalvm.org/downloads/).) ```bash - sdk install java 24-graal + sdk install java 25-graal ``` * Container runtime such as [Docker](https://www.docker.com/gettingstarted/), or [Rancher Desktop](https://docs.rancherdesktop.io/getting-started/installation/) installed and running. @@ -336,7 +336,7 @@ and the second step copies the native executable into a deployment container. > The first step in the process builds a Linux-compatible executable and the second step packages that into a container image for deployment. ```dockerfile -FROM container-registry.oracle.com/graalvm/native-image:24 AS builder +FROM container-registry.oracle.com/graalvm/native-image:25 AS builder # Set the working directory WORKDIR /build @@ -458,7 +458,7 @@ Again you are going to use a multi-stage build. Take a look at the contents of the Dockerfile, which has comments to explain each line: ```dockerfile -FROM container-registry.oracle.com/graalvm/native-image:24 AS builder +FROM container-registry.oracle.com/graalvm/native-image:25 AS builder # Set the working directory WORKDIR /build diff --git a/native-image/containerisation/lab/01-native-image/Dockerfile b/native-image/containerisation/lab/01-native-image/Dockerfile index d3daa1f..321bd3a 100644 --- a/native-image/containerisation/lab/01-native-image/Dockerfile +++ b/native-image/containerisation/lab/01-native-image/Dockerfile @@ -1,5 +1,5 @@ # Base Image -FROM container-registry.oracle.com/graalvm/native-image:24 AS builder +FROM container-registry.oracle.com/graalvm/native-image:25 AS builder # Set the working directory to /home/app WORKDIR /build diff --git a/native-image/containerisation/lab/02-smaller-containers/Dockerfile b/native-image/containerisation/lab/02-smaller-containers/Dockerfile index e189b22..a42d5c9 100644 --- a/native-image/containerisation/lab/02-smaller-containers/Dockerfile +++ b/native-image/containerisation/lab/02-smaller-containers/Dockerfile @@ -1,5 +1,5 @@ # Base Image -FROM container-registry.oracle.com/graalvm/native-image:24 AS builder +FROM container-registry.oracle.com/graalvm/native-image:25 AS builder # Set the working directory to /home/app WORKDIR /build diff --git a/native-image/micronaut-webserver/Dockerfile.alpine.static b/native-image/micronaut-webserver/Dockerfile.alpine.static index f4d007c..632ae4f 100644 --- a/native-image/micronaut-webserver/Dockerfile.alpine.static +++ b/native-image/micronaut-webserver/Dockerfile.alpine.static @@ -1,4 +1,4 @@ -FROM container-registry.oracle.com/graalvm/native-image:24-muslib AS nativebuild +FROM container-registry.oracle.com/graalvm/native-image:25-muslib AS nativebuild COPY . /webserver WORKDIR /webserver # Build a fully static native image with optimization for size diff --git a/native-image/micronaut-webserver/Dockerfile.distroless-base.mostly b/native-image/micronaut-webserver/Dockerfile.distroless-base.mostly index 3f4bd61..811491c 100644 --- a/native-image/micronaut-webserver/Dockerfile.distroless-base.mostly +++ b/native-image/micronaut-webserver/Dockerfile.distroless-base.mostly @@ -1,4 +1,4 @@ -FROM container-registry.oracle.com/graalvm/native-image:24 AS nativebuild +FROM container-registry.oracle.com/graalvm/native-image:25 AS nativebuild COPY . /webserver WORKDIR /webserver # Build a mostly statically linked native image with optimization for size diff --git a/native-image/micronaut-webserver/Dockerfile.distroless-java-base-jar b/native-image/micronaut-webserver/Dockerfile.distroless-java-base-jar index 496bed9..79998e6 100644 --- a/native-image/micronaut-webserver/Dockerfile.distroless-java-base-jar +++ b/native-image/micronaut-webserver/Dockerfile.distroless-java-base-jar @@ -1,4 +1,4 @@ -FROM container-registry.oracle.com/graalvm/jdk:24 AS build +FROM container-registry.oracle.com/graalvm/jdk:25 AS build COPY . /webserver WORKDIR /webserver RUN ./mvnw --no-transfer-progress clean package diff --git a/native-image/micronaut-webserver/Dockerfile.distroless-java-base.dynamic b/native-image/micronaut-webserver/Dockerfile.distroless-java-base.dynamic index a5a8ece..251d5df 100644 --- a/native-image/micronaut-webserver/Dockerfile.distroless-java-base.dynamic +++ b/native-image/micronaut-webserver/Dockerfile.distroless-java-base.dynamic @@ -1,4 +1,4 @@ -FROM container-registry.oracle.com/graalvm/native-image:24 AS nativebuild +FROM container-registry.oracle.com/graalvm/native-image:25 AS nativebuild COPY . /webserver WORKDIR /webserver # Build a dynamically linked native image with default configuration diff --git a/native-image/micronaut-webserver/Dockerfile.distroless-java-base.dynamic-optimized b/native-image/micronaut-webserver/Dockerfile.distroless-java-base.dynamic-optimized index 46a03c2..9e474c9 100644 --- a/native-image/micronaut-webserver/Dockerfile.distroless-java-base.dynamic-optimized +++ b/native-image/micronaut-webserver/Dockerfile.distroless-java-base.dynamic-optimized @@ -1,4 +1,4 @@ -FROM container-registry.oracle.com/graalvm/native-image:24 AS nativebuild +FROM container-registry.oracle.com/graalvm/native-image:25 AS nativebuild COPY . /webserver WORKDIR /webserver # Build a dynamically linked native image with optimization for size diff --git a/native-image/micronaut-webserver/Dockerfile.distroless-java-base.dynamic-skipflow b/native-image/micronaut-webserver/Dockerfile.distroless-java-base.dynamic-skipflow index e513d87..0fc3d18 100644 --- a/native-image/micronaut-webserver/Dockerfile.distroless-java-base.dynamic-skipflow +++ b/native-image/micronaut-webserver/Dockerfile.distroless-java-base.dynamic-skipflow @@ -1,4 +1,4 @@ -FROM container-registry.oracle.com/graalvm/native-image:24 AS nativebuild +FROM container-registry.oracle.com/graalvm/native-image:25 AS nativebuild COPY . /webserver WORKDIR /webserver # Build a dynamically linked native image with optimization for size diff --git a/native-image/micronaut-webserver/Dockerfile.distroless-java-base.jlink b/native-image/micronaut-webserver/Dockerfile.distroless-java-base.jlink index 9961ccf..6f7d3c6 100644 --- a/native-image/micronaut-webserver/Dockerfile.distroless-java-base.jlink +++ b/native-image/micronaut-webserver/Dockerfile.distroless-java-base.jlink @@ -1,10 +1,10 @@ -FROM container-registry.oracle.com/graalvm/jdk:24 AS build +FROM container-registry.oracle.com/graalvm/jdk:25 AS build COPY . /webserver WORKDIR /webserver RUN ./mvnw --no-transfer-progress clean package RUN ./mvnw dependency:build-classpath -Dmdep.outputFile=cp.txt RUN CP=$(cat cp.txt) && \ - MODULES=$(jdeps --ignore-missing-deps -q --recursive --multi-release 24 --print-module-deps --class-path "$CP" target/webserver-0.1.jar) && \ + MODULES=$(jdeps --ignore-missing-deps -q --recursive --multi-release 25 --print-module-deps --class-path "$CP" target/webserver-0.1.jar) && \ echo "Modules: $MODULES" && \ jlink \ --module-path "${JAVA_HOME}/jmods" \ diff --git a/native-image/micronaut-webserver/Dockerfile.eclispe-temurin-jar b/native-image/micronaut-webserver/Dockerfile.eclispe-temurin-jar index 4fd14a3..50da402 100644 --- a/native-image/micronaut-webserver/Dockerfile.eclispe-temurin-jar +++ b/native-image/micronaut-webserver/Dockerfile.eclispe-temurin-jar @@ -1,4 +1,4 @@ -FROM container-registry.oracle.com/graalvm/jdk:24 AS build +FROM container-registry.oracle.com/graalvm/jdk:25 AS build COPY . /webserver WORKDIR /webserver RUN ./mvnw --no-transfer-progress clean package diff --git a/native-image/micronaut-webserver/Dockerfile.scratch.static b/native-image/micronaut-webserver/Dockerfile.scratch.static index fc5e55b..cfc8d22 100644 --- a/native-image/micronaut-webserver/Dockerfile.scratch.static +++ b/native-image/micronaut-webserver/Dockerfile.scratch.static @@ -1,4 +1,4 @@ -FROM container-registry.oracle.com/graalvm/native-image:24-muslib AS nativebuild +FROM container-registry.oracle.com/graalvm/native-image:25-muslib AS nativebuild COPY . /webserver WORKDIR /webserver # Build a fully static native image with optimization for size diff --git a/native-image/micronaut-webserver/Dockerfile.scratch.static-upx b/native-image/micronaut-webserver/Dockerfile.scratch.static-upx index 00526ed..39a3fd4 100644 --- a/native-image/micronaut-webserver/Dockerfile.scratch.static-upx +++ b/native-image/micronaut-webserver/Dockerfile.scratch.static-upx @@ -1,4 +1,4 @@ -FROM container-registry.oracle.com/graalvm/native-image:24-muslib AS nativebuild +FROM container-registry.oracle.com/graalvm/native-image:25-muslib AS nativebuild COPY . /webserver WORKDIR /webserver diff --git a/native-image/micronaut-webserver/README.md b/native-image/micronaut-webserver/README.md index 27934c8..bb5beae 100644 --- a/native-image/micronaut-webserver/README.md +++ b/native-image/micronaut-webserver/README.md @@ -28,9 +28,9 @@ In this workshop you will: * x86 Linux * `musl` toolchain * Container runtime such as [Docker](https://www.docker.com/gettingstarted/), or [Rancher Desktop](https://docs.rancherdesktop.io/getting-started/installation/) installed and running. -* [GraalVM for JDK 24](https://www.graalvm.org/downloads/). We recommend using [SDKMAN!](https://sdkman.io/). (For other download options, see [GraalVM Downloads](https://www.graalvm.org/downloads/).) +* [GraalVM 25](https://www.graalvm.org/downloads/). We recommend using [SDKMAN!](https://sdkman.io/). (For other download options, see [GraalVM Downloads](https://www.graalvm.org/downloads/).) ```bash - sdk install java 24-graal + sdk install java 25-graal ``` ## Setup @@ -67,7 +67,7 @@ It requires a container image with a JDK and runtime libraries. ### Explanation -The Dockerfile provided for this step pulls [container-registry.oracle.com/graalvm/jdk:24](https://docs.oracle.com/en/graalvm/jdk/24/docs/getting-started/container-images/) for the builder, and then `gcr.io/distroless/java21-debian12` for the runtime. +The Dockerfile provided for this step pulls [container-registry.oracle.com/graalvm/jdk:25](https://docs.oracle.com/en/graalvm/jdk/25/docs/getting-started/container-images/) for the builder, and then `gcr.io/distroless/java21-debian12` for the runtime. The entrypoint for this image is equivalent to `java -jar`, so only a path to a JAR file is specified in `CMD`. ### Action @@ -112,7 +112,7 @@ See how much reduction in size you can gain. Introduced in Java 11, it provides a way to make applications more space efficient and cloud-friendly. The script _build-jlink.sh_ that runs `docker build` using the _Dockerfile.distroless-java-base.jlink_. -The Dockerfile contains two stages: first it generates a `jlink` custom runtime on a full JDK (`container-registry.oracle.com/graalvm/jdk:24`); then copies the runtime image folder along with static assets into a distroless Java base image, and sets the entrypoint. +The Dockerfile contains two stages: first it generates a `jlink` custom runtime on a full JDK (`container-registry.oracle.com/graalvm/jdk:25`); then copies the runtime image folder along with static assets into a distroless Java base image, and sets the entrypoint. Distroless Java base image provides `glibc` and other libraries needed by the JDK, **but not a full-blown JDK**. The application does not have to be modular, but you need to figure out which modules the application depends on to be able to `jlink` it. @@ -123,7 +123,7 @@ RUN ./mvnw dependency:build-classpath -Dmdep.outputFile=cp.txt Then, runs `jlink` to create a custom runtime in the specified output directory _jlink-jre_, by using the output of the `jdeps` command to obtain the required modules for this Micronaut application: ```bash RUN CP=$(cat cp.txt) && \ - MODULES=$(jdeps --ignore-missing-deps -q --recursive --multi-release 24 --print-module-deps --class-path "$CP" target/webserver-0.1.jar) && \ + MODULES=$(jdeps --ignore-missing-deps -q --recursive --multi-release 25 --print-module-deps --class-path "$CP" target/webserver-0.1.jar) && \ echo "Modules: $MODULES" && \ jlink \ --module-path "${JAVA_HOME}/jmods" \ @@ -238,7 +238,7 @@ In this step, you will build a fully dynamically linked native image **with the GraalVM Native Image provides the option `-Os` which optimizes the resulting native image for file size. `-Os` enables `-O2` optimizations except those that can increase code or executable size significantly. -Learn more about different optimization levels in the [Native Image documentation](https://www.graalvm.org/jdk24/reference-manual/native-image/optimizations-and-performance/#optimization-levels). +Learn more about different optimization levels in the [Native Image documentation](https://www.graalvm.org/jdk25/reference-manual/native-image/optimizations-and-performance/#optimization-levels). To configure the Native Image build and have more manual control over the process, GraalVM provides the [Native Build Tools](https://graalvm.github.io/native-build-tools/latest/index.html): Maven and Gradle plugins for building native images. diff --git a/native-image/native-build-tools/README.md b/native-image/native-build-tools/README.md index 43220d3..f26eb28 100644 --- a/native-image/native-build-tools/README.md +++ b/native-image/native-build-tools/README.md @@ -33,7 +33,7 @@ In workshop lab, you will: Before starting this workshop, you must have installed: -* [GraalVM for JDK 24](https://www.graalvm.org/downloads/) - you can use either the Community or Enterprise Edition. +* [GraalVM 25](https://www.graalvm.org/downloads/) - you can use either the Community or Enterprise Edition. > If you see the laptop icon in the text, this means you need to do something such as enter a command. diff --git a/native-image/native-image-quick-start/README.md b/native-image/native-image-quick-start/README.md index c1e8c4c..333a728 100644 --- a/native-image/native-image-quick-start/README.md +++ b/native-image/native-image-quick-start/README.md @@ -1,6 +1,6 @@ # GraalVM Native Image Quick Start -This workshop takes you step by step through the process of building a cloud native Java application with [GraalVM Native Image](https://docs.oracle.com/en/graalvm/jdk/24/docs/reference-manual/native-image/). +This workshop takes you step by step through the process of building a cloud native Java application with [GraalVM Native Image](https://docs.oracle.com/en/graalvm/jdk/25/docs/reference-manual/native-image/). It is aimed at developers with a knowledge of Java. GraalVM Native Image compiles Java code ahead of time into a self-contained native executable. @@ -30,7 +30,7 @@ In this workshop you will perform the following tasks: Before starting this workshop, you must have installed: -* [GraalVM for JDK 24](https://www.graalvm.org/downloads/) - you can use either the Community or Enterprise Edition. +* [GraalVM 25](https://www.graalvm.org/downloads/) - you can use either the Community or Enterprise Edition. > If you see the laptop icon in the text, this means you need to do something such as enter a command. @@ -88,7 +88,7 @@ Now that you have a basic understanding of what the application does, build it a ## **STEP 2**: Compile a Java Application into a Native Image -Next, you are going to build a native executable version of the application using [GraalVM Native Image](https://docs.oracle.com/en/graalvm/jdk/24/docs/reference-manual/native-image/). +Next, you are going to build a native executable version of the application using [GraalVM Native Image](https://docs.oracle.com/en/graalvm/jdk/25/docs/reference-manual/native-image/). #### Action @@ -129,7 +129,7 @@ What do the parameters you passed to the `native-image` command in step 1 specif * `-jar` : Specifies the location of the JAR file containing the Java application. (You can also specify the classpath with `-cp`.) * `-o`: Specifies the name of the output executable file. -The full list of options can be found [here](https://docs.oracle.com/en/graalvm/jdk/24/docs/reference-manual/native-image/overview/Options/). +The full list of options can be found [here](https://docs.oracle.com/en/graalvm/jdk/25/docs/reference-manual/native-image/overview/Options/). You can also run the `native-image` tool using the [Maven plugin for GraalVM Native Image](https://graalvm.github.io/native-build-tools/latest/maven-plugin.html). The project `pom.xml` file contains the following snippet that enables the plugin: @@ -253,15 +253,15 @@ You need a way to let `native-image` know about any uses of reflection. Luckily, the `native-image` tool is able to read in the configuration file that specify all classes that are referenced through reflection. You can write the configuration manually, or, **we recommend using the Tracing agent that comes with GraalVM**. -The [Tracing agent](https://docs.oracle.com/en/graalvm/jdk/24/docs/reference-manual/native-image/metadata/AutomaticMetadataCollection/) collects all instances of reflection, JNI, proxies, and resources access that it can locate while your application is running, and generates the JSON file, _reachability-metadata.json_ in the _resources/META-INF/native-image/_ directory. +The [Tracing agent](https://docs.oracle.com/en/graalvm/jdk/25/docs/reference-manual/native-image/metadata/AutomaticMetadataCollection/) collects all instances of reflection, JNI, proxies, and resources access that it can locate while your application is running, and generates the JSON file, _reachability-metadata.json_ in the _resources/META-INF/native-image/_ directory. **Note**: It is important to exercise all the code paths in your application when running the agent in order to ensure that all cases of reflection are identified. -The complete documentation for providing configuration can be found [here](https://docs.oracle.com/en/graalvm/jdk/24/docs/reference-manual/native-image/metadata/). +The complete documentation for providing configuration can be found [here](https://docs.oracle.com/en/graalvm/jdk/25/docs/reference-manual/native-image/metadata/). -## **STEP 4**: Use the Tracing Agent +## **STEP 4**: Use the Tracing Agent -Now use the [Tracing agent](https://docs.oracle.com/en/graalvm/jdk/24/docs/reference-manual/native-image/metadata/AutomaticMetadataCollection/) to generate the configuration while you run your application. +Now use the [Tracing agent](https://docs.oracle.com/en/graalvm/jdk/25/docs/reference-manual/native-image/metadata/AutomaticMetadataCollection/) to generate the configuration while you run your application. 1. Run the application with the agent on the JVM: diff --git a/native-image/non-fungible-verses/README.md b/native-image/non-fungible-verses/README.md index a923152..2905f0d 100644 --- a/native-image/non-fungible-verses/README.md +++ b/native-image/non-fungible-verses/README.md @@ -86,7 +86,7 @@ Create a compute instance - Image: vanilla Oracle Linux 8 Once the VM is up and running, SSH into it and carry out the following steps: -* Install [Oracle GraalVM for JDK 24](https://docs.oracle.com/en/graalvm/jdk/24/docs/getting-started/oci/compute-instance/). +* Install [Oracle GraalVM 25](https://docs.oracle.com/en/graalvm/jdk/25/docs/getting-started/oci/compute-instance/). * Stop and disable the firewall of the VM (normally this isn't recommended). * In the security list for the VCN Subnet of your VM, add an ingress rule for TCP traffic on port 8080. @@ -238,13 +238,13 @@ Now move on to running it in a container. Containerizing a Java application in a container image is straightforward. You can build a new Docker image based on one that contains a JDK distribution. -For this workshop, you will use a container with the Oracle Linux 8 and the Oracle GraalVM JDK: `container-registry.oracle.com/graalvm/jdk:24`. +For this workshop, you will use a container with the Oracle Linux 8 and the Oracle GraalVM JDK: `container-registry.oracle.com/graalvm/jdk:25`. The following is a breakdown of the Dockerfile, which describes how to build the Docker image. See the comments to explain the contents. ```dockerfile # Base Image -FROM container-registry.oracle.com/graalvm/jdk:24 +FROM container-registry.oracle.com/graalvm/jdk:25 # Pass in the JAR file as an argument to the image build ARG JAR_FILE @@ -447,7 +447,7 @@ and the second step copies the native executable into a deployment container. > The first step in the process builds a Linux-compatible executable and the second step packages that into a container image for deployment. ```dockerfile -FROM container-registry.oracle.com/graalvm/native-image:24 AS builder +FROM container-registry.oracle.com/graalvm/native-image:25 AS builder # Set the working directory WORKDIR /build @@ -569,7 +569,7 @@ Again you are going to use a multi-stage build. Take a look at the contents of the Dockerfile, which has comments to explain each line: ```dockerfile -FROM container-registry.oracle.com/graalvm/native-image:24 AS builder +FROM container-registry.oracle.com/graalvm/native-image:25 AS builder # Set the working directory WORKDIR /build diff --git a/native-image/non-fungible-verses/lab/02-smaller-containers/Dockerfile b/native-image/non-fungible-verses/lab/02-smaller-containers/Dockerfile index e189b22..a42d5c9 100644 --- a/native-image/non-fungible-verses/lab/02-smaller-containers/Dockerfile +++ b/native-image/non-fungible-verses/lab/02-smaller-containers/Dockerfile @@ -1,5 +1,5 @@ # Base Image -FROM container-registry.oracle.com/graalvm/native-image:24 AS builder +FROM container-registry.oracle.com/graalvm/native-image:25 AS builder # Set the working directory to /home/app WORKDIR /build diff --git a/native-image/reflection/README.md b/native-image/reflection/README.md index 7fa13e8..83288ca 100644 --- a/native-image/reflection/README.md +++ b/native-image/reflection/README.md @@ -28,7 +28,7 @@ In this workshop you will: Before starting this workshop, you must have installed: -* [GraalVM for JDK 24](https://www.graalvm.org/downloads/) - you can use either the Community or Enterprise Edition. +* [GraalVM 25](https://www.graalvm.org/downloads/) - you can use either the Community or Enterprise Edition. > If you see the laptop icon in the text, this means you need to do something such as enter a command. diff --git a/native-image/spring-boot-webserver/Dockerfile.alpine.static b/native-image/spring-boot-webserver/Dockerfile.alpine.static index 5bdc0ed..aa9393a 100644 --- a/native-image/spring-boot-webserver/Dockerfile.alpine.static +++ b/native-image/spring-boot-webserver/Dockerfile.alpine.static @@ -1,4 +1,4 @@ -FROM container-registry.oracle.com/graalvm/native-image:24-muslib AS nativebuild +FROM container-registry.oracle.com/graalvm/native-image:25-muslib AS nativebuild COPY . /webserver WORKDIR /webserver # Build a fully static native image with optimization for size diff --git a/native-image/spring-boot-webserver/Dockerfile.distroless-base.mostly b/native-image/spring-boot-webserver/Dockerfile.distroless-base.mostly index d6342b8..c59ffb3 100644 --- a/native-image/spring-boot-webserver/Dockerfile.distroless-base.mostly +++ b/native-image/spring-boot-webserver/Dockerfile.distroless-base.mostly @@ -1,4 +1,4 @@ -FROM container-registry.oracle.com/graalvm/native-image:24 AS nativebuild +FROM container-registry.oracle.com/graalvm/native-image:25 AS nativebuild COPY . /webserver WORKDIR /webserver # Build a mostly statically linked native image with optimization for size diff --git a/native-image/spring-boot-webserver/Dockerfile.distroless-java-base-jar b/native-image/spring-boot-webserver/Dockerfile.distroless-java-base-jar index 4f30628..64a7002 100644 --- a/native-image/spring-boot-webserver/Dockerfile.distroless-java-base-jar +++ b/native-image/spring-boot-webserver/Dockerfile.distroless-java-base-jar @@ -1,4 +1,4 @@ -FROM container-registry.oracle.com/graalvm/jdk:24 AS build +FROM container-registry.oracle.com/graalvm/jdk:25 AS build COPY . /webserver WORKDIR /webserver RUN ./mvnw clean package diff --git a/native-image/spring-boot-webserver/Dockerfile.distroless-java-base.dynamic b/native-image/spring-boot-webserver/Dockerfile.distroless-java-base.dynamic index f55a993..9eb0db1 100644 --- a/native-image/spring-boot-webserver/Dockerfile.distroless-java-base.dynamic +++ b/native-image/spring-boot-webserver/Dockerfile.distroless-java-base.dynamic @@ -1,4 +1,4 @@ -FROM container-registry.oracle.com/graalvm/native-image:24 AS nativebuild +FROM container-registry.oracle.com/graalvm/native-image:25 AS nativebuild COPY . /webserver WORKDIR /webserver # Build a dynamically linked native image with default configuration diff --git a/native-image/spring-boot-webserver/Dockerfile.distroless-java-base.dynamic-optimized b/native-image/spring-boot-webserver/Dockerfile.distroless-java-base.dynamic-optimized index 4e964a5..08bb21b 100644 --- a/native-image/spring-boot-webserver/Dockerfile.distroless-java-base.dynamic-optimized +++ b/native-image/spring-boot-webserver/Dockerfile.distroless-java-base.dynamic-optimized @@ -1,4 +1,4 @@ -FROM container-registry.oracle.com/graalvm/native-image:24 AS nativebuild +FROM container-registry.oracle.com/graalvm/native-image:25 AS nativebuild COPY . /webserver WORKDIR /webserver # Build a dynamically linked native image with optimization for size diff --git a/native-image/spring-boot-webserver/Dockerfile.distroless-java-base.dynamic-skipflow b/native-image/spring-boot-webserver/Dockerfile.distroless-java-base.dynamic-skipflow index 6dd7d25..edd7316 100644 --- a/native-image/spring-boot-webserver/Dockerfile.distroless-java-base.dynamic-skipflow +++ b/native-image/spring-boot-webserver/Dockerfile.distroless-java-base.dynamic-skipflow @@ -1,4 +1,4 @@ -FROM container-registry.oracle.com/graalvm/native-image:24 AS nativebuild +FROM container-registry.oracle.com/graalvm/native-image:25 AS nativebuild COPY . /webserver WORKDIR /webserver # Build a dynamically linked native image with optimization for size diff --git a/native-image/spring-boot-webserver/Dockerfile.distroless-java-base.jlink b/native-image/spring-boot-webserver/Dockerfile.distroless-java-base.jlink index 519e958..5e939ec 100644 --- a/native-image/spring-boot-webserver/Dockerfile.distroless-java-base.jlink +++ b/native-image/spring-boot-webserver/Dockerfile.distroless-java-base.jlink @@ -1,4 +1,4 @@ -FROM container-registry.oracle.com/graalvm/jdk:24 AS build +FROM container-registry.oracle.com/graalvm/jdk:25 AS build COPY . /webserver WORKDIR /webserver RUN ./mvnw clean package diff --git a/native-image/spring-boot-webserver/Dockerfile.eclispe-temurin-jar b/native-image/spring-boot-webserver/Dockerfile.eclispe-temurin-jar index ab57567..dda37f1 100644 --- a/native-image/spring-boot-webserver/Dockerfile.eclispe-temurin-jar +++ b/native-image/spring-boot-webserver/Dockerfile.eclispe-temurin-jar @@ -1,4 +1,4 @@ -FROM container-registry.oracle.com/graalvm/jdk:24 AS build +FROM container-registry.oracle.com/graalvm/jdk:25 AS build COPY . /webserver WORKDIR /webserver RUN ./mvnw clean package diff --git a/native-image/spring-boot-webserver/Dockerfile.scratch.static b/native-image/spring-boot-webserver/Dockerfile.scratch.static index d1b6553..4b01feb 100644 --- a/native-image/spring-boot-webserver/Dockerfile.scratch.static +++ b/native-image/spring-boot-webserver/Dockerfile.scratch.static @@ -1,4 +1,4 @@ -FROM container-registry.oracle.com/graalvm/native-image:24-muslib AS nativebuild +FROM container-registry.oracle.com/graalvm/native-image:25-muslib AS nativebuild COPY . /webserver WORKDIR /webserver # Build a fully static native image with optimization for size diff --git a/native-image/spring-boot-webserver/Dockerfile.scratch.static-upx b/native-image/spring-boot-webserver/Dockerfile.scratch.static-upx index eecb3fd..4e9b598 100644 --- a/native-image/spring-boot-webserver/Dockerfile.scratch.static-upx +++ b/native-image/spring-boot-webserver/Dockerfile.scratch.static-upx @@ -1,4 +1,4 @@ -FROM container-registry.oracle.com/graalvm/native-image:24-muslib AS nativebuild +FROM container-registry.oracle.com/graalvm/native-image:25-muslib AS nativebuild COPY . /webserver WORKDIR /webserver diff --git a/native-image/spring-boot-webserver/README.md b/native-image/spring-boot-webserver/README.md index 20d7613..7a6d4b2 100644 --- a/native-image/spring-boot-webserver/README.md +++ b/native-image/spring-boot-webserver/README.md @@ -28,9 +28,9 @@ In this workshop you will: * x86 Linux * `musl` toolchain * Container runtime such as [Docker](https://www.docker.com/gettingstarted/), or [Rancher Desktop](https://docs.rancherdesktop.io/getting-started/installation/) installed and running. -* [GraalVM for JDK 24](https://www.graalvm.org/downloads/). We recommend using [SDKMAN!](https://sdkman.io/). (For other download options, see [GraalVM Downloads](https://www.graalvm.org/downloads/).) +* [GraalVM 25](https://www.graalvm.org/downloads/). We recommend using [SDKMAN!](https://sdkman.io/). (For other download options, see [GraalVM Downloads](https://www.graalvm.org/downloads/).) ```bash - sdk install java 24-graal + sdk install java 25-graal ``` ## Setup @@ -67,7 +67,7 @@ It requires a container image with a full JDK and runtime libraries. ### Explanation -The Dockerfile provided for this step pulls [container-registry.oracle.com/graalvm/jdk:24](https://docs.oracle.com/en/graalvm/jdk/24/docs/getting-started/container-images/) for the builder, and then `gcr.io/distroless/java21-debian12` for the runtime. +The Dockerfile provided for this step pulls [container-registry.oracle.com/graalvm/jdk:25](https://docs.oracle.com/en/graalvm/jdk/25/docs/getting-started/container-images/) for the builder, and then `gcr.io/distroless/java21-debian12` for the runtime. The entrypoint for this image is equivalent to `java -jar`, so only a path to a JAR file is specified in `CMD`. ### Action @@ -108,7 +108,7 @@ See how much reduction in size you can gain. This is one of the approaches to make applications more space efficient and cloud-friendly, introduced in Java 11. The script _build-jlink.sh_ that runs `docker build` using the _Dockerfile.distroless-java-base.jlink_. -The Dockerfile runs two stages: first it generates a jlink custom runtime on a full JDK (`container-registry.oracle.com/graalvm/jdk:24`); then copies the runtime image folder along with static website pages into a distroless Java base image, and sets the entrypoint. +The Dockerfile runs two stages: first it generates a jlink custom runtime on a full JDK (`container-registry.oracle.com/graalvm/jdk:25`); then copies the runtime image folder along with static website pages into a distroless Java base image, and sets the entrypoint. Distroless Java base image provides `glibc` and other libraries needed by the JDK, but not a full-blown JDK. The application does not have to be modular, but you need to figure out which modules the application depends on to be able to `jlink` it. @@ -118,7 +118,7 @@ RUN ./mvnw dependency:build-classpath -Dmdep.outputFile=cp.txt ``` Then, Docker runs the `jdeps` command with the classpath to check required modules for this Spring Boot application: ```bash -RUN jdeps --ignore-missing-deps -q --recursive --multi-release 24 --print-module-deps --class-path $(cat cp.txt) target/webserver-0.0.1-SNAPSHOT.jar +RUN jdeps --ignore-missing-deps -q --recursive --multi-release 25 --print-module-deps --class-path $(cat cp.txt) target/webserver-0.0.1-SNAPSHOT.jar ``` Finally, Docker runs `jlink` to create a custom runtime in the specified output directory _jlink-jre_. The `ENTRYPOINT` for the application would be `java` from the custom runtime. @@ -285,7 +285,7 @@ In this step, you will build a fully dynamically linked native image **with the GraalVM Native Image provides the option `-Os` which optimizes the resulting native image for file size. `-Os` enables `-O2` optimizations except those that can increase code or executable size significantly. -Learn more in [the Native Image documentation](https://www.graalvm.org/jdk24/reference-manual/native-image/optimizations-and-performance/#optimization-levels). +Learn more in [the Native Image documentation](https://www.graalvm.org/jdk25/reference-manual/native-image/optimizations-and-performance/#optimization-levels). For that, a separate Maven profile is provided to differentiate this run from the default build, and giving a different name for the output file: ```xml diff --git a/native-image/what-the-dickens/README.md b/native-image/what-the-dickens/README.md index cb5a145..c53de86 100644 --- a/native-image/what-the-dickens/README.md +++ b/native-image/what-the-dickens/README.md @@ -20,7 +20,7 @@ Estimated workshop time: 60 minutes Before starting this workshop, you must have installed: -* [GraalVM for JDK 24](https://www.graalvm.org/downloads/) - you can use either the Community or Enterprise Edition. +* [GraalVM 25](https://www.graalvm.org/downloads/) - you can use either the Community or Enterprise Edition. * A Docker-API compatible container runtime such as [Rancher Desktop](https://docs.rancherdesktop.io/getting-started/installation/), [Docker](https://www.docker.io/gettingstarted/), or [Podman](https://podman.io/getting-started/installation). ## **STEP 1**: Introducing the Sample Java Application @@ -284,7 +284,7 @@ the second step copies the native executable into a deployment container. ```dockerfile # Base Container Image -FROM container-registry.oracle.com/graalvm/native-image:24 AS builder +FROM container-registry.oracle.com/graalvm/native-image:25 AS builder # Set the working directory to /build WORKDIR /build @@ -393,7 +393,7 @@ the second step copies the native executable into a Distroless container. ```dockerfile # Base Container Image -FROM container-registry.oracle.com/graalvm/native-image:24 AS builder +FROM container-registry.oracle.com/graalvm/native-image:25 AS builder # Set the working directory to /build WORKDIR /build @@ -494,7 +494,7 @@ Such an executable can be packaged in smaller Distroless containers, which enabl ### Learn More -- [Static and Mostly Static Images](https://www.graalvm.org/jdk24/reference-manual/native-image/guides/build-static-executables/) +- [Static and Mostly Static Images](https://www.graalvm.org/jdk25/reference-manual/native-image/guides/build-static-executables/) - [Tiny Java Containers](https://github.com/graalvm/graalvm-demos/tree/master/native-image/tiny-java-containers) - [Native Build Tools](https://graalvm.github.io/native-build-tools/latest/index.html) - [Improving Java Application Security with Practical Hardening Strategies by Shaun Smith at DevoxxUK 2024](https://www.youtube.com/watch?v=dBbYnVSTwQs) \ No newline at end of file diff --git a/native-image/what-the-dickens/lab/01-native-image/Dockerfile b/native-image/what-the-dickens/lab/01-native-image/Dockerfile index 76cb784..2ab021a 100644 --- a/native-image/what-the-dickens/lab/01-native-image/Dockerfile +++ b/native-image/what-the-dickens/lab/01-native-image/Dockerfile @@ -1,5 +1,5 @@ # Base Container Image -FROM container-registry.oracle.com/graalvm/native-image:24 AS builder +FROM container-registry.oracle.com/graalvm/native-image:25 AS builder # Set the working directory to /build WORKDIR /build diff --git a/native-image/what-the-dickens/lab/02-smaller-containers/Dockerfile b/native-image/what-the-dickens/lab/02-smaller-containers/Dockerfile index 825db8e..7cd83f9 100644 --- a/native-image/what-the-dickens/lab/02-smaller-containers/Dockerfile +++ b/native-image/what-the-dickens/lab/02-smaller-containers/Dockerfile @@ -1,5 +1,5 @@ # Base Container Image -FROM container-registry.oracle.com/graalvm/native-image:24 AS builder +FROM container-registry.oracle.com/graalvm/native-image:25 AS builder # Set the working directory to /build WORKDIR /build diff --git a/native-image/what-the-dickens/lab/HELP.md b/native-image/what-the-dickens/lab/HELP.md index c252057..f24f6b6 100644 --- a/native-image/what-the-dickens/lab/HELP.md +++ b/native-image/what-the-dickens/lab/HELP.md @@ -21,7 +21,7 @@ docker run --rm what_the_dickens:0.0.1-SNAPSHOT ### Executable with Native Build Tools Use this option if you want to explore more options such as running your tests as a native code. -[GraalVM for JDK 24](https://www.graalvm.org/downloads/) should be installed on your machine. +[GraalVM 25](https://www.graalvm.org/downloads/) should be installed on your machine. To create the executable, run the following goal: ```bash