docs: migrate to v2 jre#953
Open
asanvaq wants to merge 3 commits into
Open
Conversation
alesancor1
requested changes
May 4, 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 |
Member
There was a problem hiding this comment.
We should cover this using docker.legacy fields.
Contributor
Author
There was a problem hiding this comment.
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.
Contributor
There was a problem hiding this comment.
@asanvaq there are some notes in the deleted sections:
There as also readmes for the each image:
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" ] | ||
| ``` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Update docs to v2.