Image Overview: jre

Overview: jre Chainguard Image


This image will switch from including a full complement of JDK binaries to a minimally required set in a forthcoming release. The work is being tracked in this GitHub issue.

If you rely on any binaries or libraries that are included in this image beyond the core JRE runtime, consider switching to the JDK Image.

Minimalist Wolfi-based Java JRE image using OpenJDK. Used for running Java applications.

Download this Image

The image is available on

docker pull

Java Application Example

This section outlines how you can build a Java application with the Chainguard JRE Image.

Start by creating a sample Java class named

cat > <<EOL
class HelloWolfi
    public static void main(String args[])
        System.out.println("Hello Wolfi users!");

Then create a multistage Dockerfile, adding the Java class you just created:

cat >Dockerfile <<EOL

COPY /home/build/
RUN javac


COPY --from=0 /home/build/HelloWolfi.class /app/
CMD ["HelloWolfi"]

Following that, you can build the image:

docker build -t my-java-app .

Note that this example tags the image with my-java-app. You can now run the image by referencing this tag, as in the following command:

docker run my-java-app
Hello Wolfi users!

Last updated: 2024-04-11 12:38