ubuntu/jre

Verified Publisher

By Canonical

Updated 3 days ago

Chiseled Java runtime based on Ubuntu. Long-term tracks maintained by Canonical.

Image
Languages & frameworks
25

500K+

ubuntu/jre repository overview

ubuntu/jre is a rock for jre maintained by Canonical.

OpenJDK is the official reference implementation of Java Platform, Standard Edition (Java SE), since version 7. This image packs the Java Runtime Environment, coming from the OpenJDK project, a free and open source implementation of the Java Platform, Standard Edition (Java SE).

Java is a registered trademark of Oracle and/or its affiliates.

[Learn more about jre]

Tags and Architectures

NOTE: These tags follow a specific naming convention that respects the concept of channels.

TagsSupported untilVersionBaseArchitectures
25-26.04_stable
aliases25-26.04, 25-26.04_beta, 25-26.04_candidate, 25-26.04_edge
05/20312526.04arm64, amd64
21-24.04_stable
aliases21-24.04, 21-24.04_beta, 21-24.04_candidate, 21-24.04_edge
05/20292124.04arm64, amd64
17-24.04_stable
aliases17-24.04, 17-24.04_beta, 17-24.04_candidate, 17-24.04_edge
05/20291724.04arm64, amd64
11-24.04_stable
aliases11-24.04, 11-24.04_beta, 11-24.04_candidate, 11-24.04_edge
05/20291124.04amd64, arm64
17-22.04_edge
aliases17-22.04_114, 17-22.04_edge_114, 17_edge, edge
06/20271722.04amd64, arm64
8-22.04_edge
aliases8-22.04_112, 8-22.04_edge_112, 8_edge
06/2027822.04amd64, arm64

Get started

This rock's entrypoint is Pebble, a container-optimized init process that enables the orchestration of a collection of local service processes as an organized set.

[Learn more about Pebble]

Inspect

To view the Pebble services and checks defined in this rock:

docker run --rm ubuntu/jre:25-26.04_stable plan
For an older version that is not a rock

The container spins up with the default entrypoint. To inspect the entrypoint and command:

docker inspect --format='{{.Config.Entrypoint}} {{.Config.Cmd}}' ubuntu/jre:25-26.04_stable
Run

To run this rock, use any of the usual container runtimes, for example, docker:

docker run --name jre-container \
    --rm \
    ubuntu/jre:25-26.04_stable \
    exec java

The container logs will simply show the OpenJRE help message. This is because the container expects a compiled Java application to be given.

Let's use the following Hello World application as an example:

// HelloWorld.java

class HelloWorld
{
    public static void main(String args[])
    {
        System.out.println("Hello, World");
    }
}

You can build and package the above Hello World application with chiselled Ubuntu 24.04 using the following example Dockerfile.

FROM ubuntu:24.04 AS builder
RUN apt-get update && apt-get install -y openjdk-8-jdk
WORKDIR /app
ADD HelloWorld.java .

RUN javac -source 8 -target 8 HelloWorld.java -d .

FROM ubuntu/jre:21-24.04_edge

COPY --from=builder /app/HelloWorld.class .

CMD [ "exec", "java", "-cp", "/", "HelloWorld" ]
For an older version that is not a rock
docker run --name jre-container \
    --rm \
    ubuntu/jre:25-26.04_stable

The Ubuntu 22.04 JRE images are Dockerfile-based images.

You can build and package the above Hello World application with chiselled Ubuntu 22.04 JRE 8 and 17 using the following example Dockerfile.

FROM ubuntu:22.04 AS builder
RUN apt-get update && apt-get install -y openjdk-8-jdk
WORKDIR /app
ADD HelloWorld.java .

RUN javac -source 8 -target 8 HelloWorld.java -d .

FROM ubuntu/jre:8-22.04_edge

WORKDIR /
COPY --from=builder /app/HelloWorld.class .

CMD [ "HelloWorld" ]
java [options] <mainclass> [args...]
...

Get logs

To view the logs of the running container, run:

docker exec jre-container pebble logs

Or, for a specific service:

docker exec jre-container pebble logs <service>
For an older version that is not a rock

To view the logs of the running container, run:

docker logs jre-container
Monitor health checks

Rocks may have predefined health checks that you can list by running:

docker exec jre-container pebble checks

The overall health of your container can be inspected via:

docker exec jre-container pebble health

Configuration

Environment variables
OptionDescriptionDefault
TZConfigures the timezone value for Java process execution.None
Volumes
OptionDescriptionDefault
-v <host-path>:/appConfigure with a host mount to provide compiled classes or application files.None
Application parameters
OptionDescriptionDefault
exec java <args>Execute with Java command arguments or classpath options.None
Other configuration options
OptionDescriptionDefault
--rmRun with automatic container cleanup after exit.None

[Report a bug] [Contribute]

Canonical is the provider of this container image. It is the user's responsibility to ensure that any use of this image complies with any relevant licenses for all software contained within, as well as with Canonical’s IP Policy.

Tag summary

Content type

Image

Digest

sha256:a9e735f98

Size

71.4 MB

Last updated

3 days ago

docker pull ubuntu/jre:25-26.04_stable

This week's pulls

Pulls:

3,006

Last week