DirectorySecurity advisories
Sign in

Directory

jre logo

jre

Last changed
Get started with latest for free
docker pull cgr.dev/chainguard/jre

Need access to a specific version? Contact us.

Sign in for updates

Get notified of upcoming product changes, critical vulnerability notifications and patches and more.

Sign in
Versions
Overview
Provenance
Specifications
SBOM
Vulnerabilities
Advisories

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

Download this Image

The latest builds of Chainguard's JRE image passes the TCK for OpenJDK Java 21.0.3 and Java 22.0.1 as provided by (Oracle under the OpenJDK Community TCK License Agreement)[https://openjdk.org/groups/conformance/JckAccess/index.html] (OCTLA) and are Java Compatibility Kit (JCK) conformant.

The image is available on cgr.dev:

docker pull cgr.dev/chainguard/jre:latest

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 HelloWolfi.java:

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

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

cat >Dockerfile <<EOL
FROM cgr.dev/chainguard/jdk

COPY HelloWolfi.java /home/build/
RUN javac HelloWolfi.java

FROM cgr.dev/chainguard/jre

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

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!
Licenses

Chainguard Images contain software packages that are direct or transitive dependencies. The following licenses were found in the "latest" version of this image:

  • IJG

  • MIT

  • X11

  • Zlib

  • Apache-2.0

  • BSD-3-Clause

  • Bitstream-Vera

View more

For a complete list of licenses, please refer to this Image's SBOM.

Software license agreement 

Related images

Category
base
languages

Products

Chainguard Images

© 2024 Chainguard, Inc.