Skip to content

docs: migrate to v2 jre#953

Open
asanvaq wants to merge 3 commits into
canonical:mainfrom
asanvaq:jre
Open

docs: migrate to v2 jre#953
asanvaq wants to merge 3 commits into
canonical:mainfrom
asanvaq:jre

Conversation

@asanvaq
Copy link
Copy Markdown
Contributor

@asanvaq asanvaq commented Apr 18, 2026


Description

Update docs to v2.

@zhijie-yang zhijie-yang added the documentation Improvements or additions to documentation label Apr 20, 2026
Comment on lines -25 to -26
Please note that the Ubuntu 22.04 JRE images are Dockerfile-base
images, whereas from Ubuntu 24.04 onward the images
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should cover this using docker.legacy fields.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you provide some information about how to use the legacy docker images? @vpa1977

Check this section of the docs for reference about the docker.legacy field.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@vpa1977 Thank you!

Comment on lines -50 to -108
For Ubuntu 24.04 JRE

```bash
docker run --rm --name jre-container -e TZ=UTC ubuntu/jre:21-24.04_edge 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:

```java
// 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 22.04 JRE 8 and 17 using the following example
Dockerfile.

```docker
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" ]
```

For Ubuntu 24.04 please use

```docker
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" ]
```
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing

@vpa1977 vpa1977 mentioned this pull request May 24, 2026
2 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants