Skip to content

Commit fe54e86

Browse files
committed
Switch to UBI 9 by default
- Update UBI 8 and UBI 9 versions (including OpenJDK images) - Switch the default to UBI 9 This commit does not cover the builder images and the quarkus-micro images as they are not yet available using UBI9.
1 parent 49c8fe9 commit fe54e86

File tree

33 files changed

+78
-72
lines changed

33 files changed

+78
-72
lines changed

core/deployment/src/main/java/io/quarkus/deployment/images/ContainerImages.java

Lines changed: 22 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@
77
* <p>
88
* For each image, the image name and version are defined as constants:
99
* <p>
10-
* - {@code x_IMAGE_NAME} - the name of the image without the version (e.g. {@code registry.access.redhat.com/ubi8/ubi-minimal})
11-
* - {@code x_VERSION} - the version of the image (e.g. {@code 8.10})
12-
* - {@code x} - the full image name (e.g. {@code registry.access.redhat.com/ubi8/ubi-minimal:8.10})
10+
* - {@code x_IMAGE_NAME} - the name of the image without the version (e.g. {@code registry.access.redhat.com/ubi9/ubi-minimal})
11+
* - {@code x_VERSION} - the version of the image (e.g. {@code 9.5})
12+
* - {@code x} - the full image name (e.g. {@code registry.access.redhat.com/ubi9/ubi-minimal:9.5})
1313
*/
1414
public class ContainerImages {
1515

@@ -21,14 +21,19 @@ public class ContainerImages {
2121
public static final String UBI8_VERSION = "8.10";
2222

2323
/**
24-
* UBI 8 version
24+
* UBI 9 version
25+
*/
26+
public static final String UBI9_VERSION = "9.5";
27+
28+
/**
29+
* Version used for more UBI8 Java images.
2530
*/
26-
public static final String UBI9_VERSION = "9.4";
31+
public static final String UBI8_JAVA_VERSION = "1.21";
2732

2833
/**
29-
* Version used for more UBI Java images.
34+
* Version used for more UBI9 Java images.
3035
*/
31-
public static final String UBI8_JAVA_VERSION = "1.20";
36+
public static final String UBI9_JAVA_VERSION = "1.21";
3237

3338
/**
3439
* Version uses for the native builder image.
@@ -66,12 +71,12 @@ public class ContainerImages {
6671

6772
// UBI 9 OpenJDK 17 Runtime - https://catalog.redhat.com/software/containers/ubi9/openjdk-17-runtime/61ee7d45384a3eb331996bee
6873
public static final String UBI9_JAVA_17_IMAGE_NAME = "registry.access.redhat.com/ubi9/openjdk-17-runtime";
69-
public static final String UBI9_JAVA_17_VERSION = UBI8_JAVA_VERSION;
74+
public static final String UBI9_JAVA_17_VERSION = UBI9_JAVA_VERSION;
7075
public static final String UBI9_JAVA_17 = UBI9_JAVA_17_IMAGE_NAME + ":" + UBI9_JAVA_17_VERSION;
7176

7277
// UBI 9 OpenJDK 21 Runtime - https://catalog.redhat.com/software/containers/ubi9/openjdk-21-runtime/6501ce769a0d86945c422d5f
7378
public static final String UBI9_JAVA_21_IMAGE_NAME = "registry.access.redhat.com/ubi9/openjdk-21-runtime";
74-
public static final String UBI9_JAVA_21_VERSION = UBI8_JAVA_VERSION;
79+
public static final String UBI9_JAVA_21_VERSION = UBI9_JAVA_VERSION;
7580
public static final String UBI9_JAVA_21 = UBI9_JAVA_21_IMAGE_NAME + ":" + UBI9_JAVA_21_VERSION;
7681

7782
// === Source To Image images
@@ -81,14 +86,14 @@ public class ContainerImages {
8186
public static final String QUARKUS_BINARY_S2I_VERSION = "2.0";
8287
public static final String QUARKUS_BINARY_S2I = QUARKUS_BINARY_S2I_IMAGE_NAME + ":" + QUARKUS_BINARY_S2I_VERSION;
8388

84-
// Java 17 Source To Image - https://catalog.redhat.com/software/containers/ubi8/openjdk-17/618bdbf34ae3739687568813
85-
public static final String S2I_JAVA_17_IMAGE_NAME = "registry.access.redhat.com/ubi8/openjdk-17";
86-
public static final String S2I_JAVA_17_VERSION = UBI8_JAVA_VERSION;
89+
// Java 17 Source To Image - https://catalog.redhat.com/software/containers/ubi9/openjdk-17/61ee7c26ed74b2ffb22b07f6
90+
public static final String S2I_JAVA_17_IMAGE_NAME = "registry.access.redhat.com/ubi9/openjdk-17";
91+
public static final String S2I_JAVA_17_VERSION = UBI9_JAVA_VERSION;
8792
public static final String S2I_JAVA_17 = S2I_JAVA_17_IMAGE_NAME + ":" + S2I_JAVA_17_VERSION;
8893

89-
// Java Source To Image - https://catalog.redhat.com/software/containers/ubi8/openjdk-21/653fb7e21b2ec10f7dfc10d0?q=openjdk%2021&architecture=amd64&image=66bcc007a3857fbc34f4dce1
90-
public static final String S2I_JAVA_21_IMAGE_NAME = "registry.access.redhat.com/ubi8/openjdk-21";
91-
public static final String S2I_JAVA_21_VERSION = UBI8_JAVA_VERSION;
94+
// Java Source To Image - https://catalog.redhat.com/software/containers/ubi9/openjdk-21/6501cdb5c34ae048c44f7814
95+
public static final String S2I_JAVA_21_IMAGE_NAME = "registry.access.redhat.com/ubi9/openjdk-21";
96+
public static final String S2I_JAVA_21_VERSION = UBI9_JAVA_VERSION;
9297
public static final String S2I_JAVA_21 = S2I_JAVA_21_IMAGE_NAME + ":" + S2I_JAVA_21_VERSION;
9398

9499
// === Native Builder images
@@ -106,9 +111,9 @@ public class ContainerImages {
106111
public static String getDefaultJvmImage(CompiledJavaVersionBuildItem.JavaVersion version) {
107112
switch (version.isJava21OrHigher()) {
108113
case TRUE:
109-
return UBI8_JAVA_21;
114+
return UBI9_JAVA_21;
110115
default:
111-
return UBI8_JAVA_17;
116+
return UBI9_JAVA_17;
112117
}
113118
}
114119
}

docs/src/main/asciidoc/building-native-image.adoc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -510,13 +510,13 @@ ENTRYPOINT ["./application", "-Dquarkus.http.host=0.0.0.0"]
510510
.Quarkus Micro Image?
511511
====
512512
The Quarkus Micro Image is a small container image providing the right set of dependencies to run your native application.
513-
It is based on https://catalog.redhat.com/software/containers/ubi8-micro/601a84aadd19c7786c47c8ea?container-tabs=overview[UBI Micro].
513+
It is based on https://catalog.redhat.com/software/containers/ubi9-micro/61832b36dd607bfc82e66399?container-tabs=overview[UBI Micro].
514514
This base image has been tailored to work perfectly in containers.
515515
516516
You can read more about UBI images on:
517517
518518
* https://www.redhat.com/en/blog/introducing-red-hat-universal-base-image[Introduction to Universal Base Image]
519-
* https://catalog.redhat.com/software/container-stacks/detail/5ec53f50ef29fd35586d9a56[Red Hat Universal Base Image 8]
519+
* https://catalog.redhat.com/software/containers/ubi9/ubi/615bcf606feffc5384e8452e[Red Hat Universal Base Image 9]
520520
521521
UBI images can be used without any limitations.
522522
@@ -543,7 +543,7 @@ The project generation has also provided a `Dockerfile.native` in the `src/main/
543543

544544
[source,dockerfile]
545545
----
546-
FROM registry.access.redhat.com/ubi8/ubi-minimal:8.10
546+
FROM registry.access.redhat.com/ubi9/ubi-minimal:9.5
547547
WORKDIR /work/
548548
RUN chown 1001 /work \
549549
&& chmod "g+rwX" /work \

docs/src/main/asciidoc/container-image.adoc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ For example, the presence of `src/main/jib/foo/bar` would result in `/foo/bar`
4848

4949
There are cases where the built container image may need to have Java debugging conditionally enabled at runtime.
5050

51-
When the base image has not been changed (and therefore `ubi8/openjdk-11-runtime`, `ubi8/openjdk-17-runtime`, or `ubi8/openjdk-21-runtime` is used), then the `quarkus.jib.jvm-additional-arguments` configuration property can be used in order to
51+
When the base image has not been changed (and therefore `ubi9/openjdk-17-runtime`, or `ubi9/openjdk-21-runtime` is used), then the `quarkus.jib.jvm-additional-arguments` configuration property can be used in order to
5252
make the JVM listen on the debug port at startup.
5353

5454
The exact configuration is:
@@ -64,7 +64,7 @@ Other base images might provide launch scripts that enable debugging when an env
6464

6565
The `quarkus.jib.jvm-entrypoint` configuration property can be used to completely override the container entry point and can thus be used to either hard code the JVM debug configuration or point to a script that handles the details.
6666

67-
For example, if the base images `ubi8/openjdk-11-runtime`, `ubi8/openjdk-17-runtime` or `ubi8/openjdk-21-runtime` are used to build the container, the entry point can be hard-coded on the application properties file.
67+
For example, if the base images `ubi9/openjdk-17-runtime` or `ubi9/openjdk-21-runtime` are used to build the container, the entry point can be hard-coded on the application properties file.
6868

6969
.Example application.properties
7070
[source,properties]
@@ -89,7 +89,7 @@ java \
8989
-jar quarkus-run.jar
9090
----
9191

92-
NOTE: `/home/jboss` is the WORKDIR for all quarkus binaries in the base images `ubi8/openjdk-11-runtime`, `ubi8/openjdk-17-runtime` and `ubi8/openjdk-21-runtime` (https://catalog.redhat.com/software/containers/ubi8/openjdk-17/618bdbf34ae3739687568813?container-tabs=dockerfile[Dockerfile for ubi8/openjdk-17-runtime, window="_blank"])
92+
NOTE: `/home/jboss` is the WORKDIR for all quarkus binaries in the base images `ubi9/openjdk-17-runtime` and `ubi9/openjdk-21-runtime` (https://catalog.redhat.com/software/containers/ubi9/openjdk-21-runtime/6501ce769a0d86945c422d5f?container-tabs=dockerfile[Dockerfile for ubi9/openjdk-17-runtime, window="_blank"])
9393

9494
==== Multi-module projects and layering
9595

docs/src/main/asciidoc/quarkus-runtime-base-image.adoc

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,15 +101,16 @@ CMD ["./application", "-Dquarkus.http.host=0.0.0.0"]
101101

102102
== Alternative - Using ubi-minimal
103103

104-
If the micro image does not suit your requirements, you can use https://catalog.redhat.com/software/containers/ubi8/ubi-minimal/5c359a62bed8bd75a2c3fba8[ubi8/ubi-minimal].
104+
105+
If the micro image does not suit your requirements, you can use https://catalog.redhat.com/software/containers/ubi9-minimal/61832888c0d15aff4912fe0d[ubi9-minimal].
105106
It's a bigger image, but contains more utilities and is closer to a full Linux distribution.
106107
Typically, it contains a package manager (`microdnf`), so you can install packages more easily.
107108

108109
To use this base image, use the following `Dockerfile`:
109110

110111
[source, dockerfile]
111112
----
112-
FROM registry.access.redhat.com/ubi8/ubi-minimal:8.10
113+
FROM registry.access.redhat.com/ubi9/ubi-minimal:9.5
113114
WORKDIR /work/
114115
RUN chown 1001 /work \
115116
&& chmod "g+rwX" /work \

docs/src/main/asciidoc/virtual-threads.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -349,7 +349,7 @@ To containerize your Quarkus application that use `@RunOnVirtualThread`, add the
349349
quarkus.container-image.build=true
350350
quarkus.container-image.group=<your-group-name>
351351
quarkus.container-image.name=<you-container-name>
352-
quarkus.jib.base-jvm-image=registry.access.redhat.com/ubi8/openjdk-21-runtime <1>
352+
quarkus.jib.base-jvm-image=registry.access.redhat.com/ubi9/openjdk-21-runtime <1>
353353
quarkus.jib.platforms=linux/amd64,linux/arm64 <2>
354354
----
355355
<1> Make sure you use a base image supporting virtual threads. Here we use an image providing Java 21. Quarkus picks an image providing Java 21+ automatically if you do not set one.

extensions/container-image/container-image-docker-common/deployment/src/test/resources/ubi8-openjdk-17-runtime

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM registry.access.redhat.com/ubi8/openjdk-17-runtime:1.20
1+
FROM registry.access.redhat.com/ubi8/openjdk-17-runtime:1.21
22

33
ENV LANG='en_US.UTF-8' LANGUAGE='en_US:en'
44

extensions/container-image/container-image-docker-common/deployment/src/test/resources/ubi8-openjdk-21-runtime

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Use Java 21 base image
2-
FROM registry.access.redhat.com/ubi8/openjdk-21-runtime:1.20
2+
FROM registry.access.redhat.com/ubi8/openjdk-21-runtime:1.21
33

44
ENV LANG='en_US.UTF-8' LANGUAGE='en_US:en'
55

extensions/container-image/container-image-docker-common/deployment/src/test/resources/ubi9-java17

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
FROM registry.access.redhat.com/ubi9/ubi-minimal:9.4
1+
FROM registry.access.redhat.com/ubi9/ubi-minimal:9.5
22

33
ARG JAVA_PACKAGE=java-17-openjdk-headless
44
ARG RUN_JAVA_VERSION=1.3.8
55
ENV LANG='en_US.UTF-8' LANGUAGE='en_US:en'
66
# Install java and the run-java script
77
# Also set up permissions for user `1001`
8-
RUN microdnf install curl ca-certificates ${JAVA_PACKAGE} \
9-
&& microdnf update \
10-
&& microdnf clean all \
8+
RUN microdnf -y install ca-certificates ${JAVA_PACKAGE} \
9+
&& microdnf -y update \
10+
&& microdnf -y clean all \
1111
&& mkdir /deployments \
1212
&& chown 1001 /deployments \
1313
&& chmod "g+rwX" /deployments \

extensions/container-image/container-image-docker-common/deployment/src/test/resources/ubi9-java21

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
FROM registry.access.redhat.com/ubi9/ubi-minimal:9.4
1+
FROM registry.access.redhat.com/ubi9/ubi-minimal:9.5
22

33
ARG JAVA_PACKAGE=java-21-openjdk-headless
44
ARG RUN_JAVA_VERSION=1.3.8
55
ENV LANG='en_US.UTF-8' LANGUAGE='en_US:en'
66
# Install java and the run-java script
77
# Also set up permissions for user `1001`
8-
RUN microdnf install curl ca-certificates ${JAVA_PACKAGE} \
9-
&& microdnf update \
10-
&& microdnf clean all \
8+
RUN microdnf -y install ca-certificates ${JAVA_PACKAGE} \
9+
&& microdnf -y update \
10+
&& microdnf -y clean all \
1111
&& mkdir /deployments \
1212
&& chown 1001 /deployments \
1313
&& chmod "g+rwX" /deployments \

extensions/container-image/container-image-docker-common/deployment/src/test/resources/ubi9-openjdk-17-runtime

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM registry.access.redhat.com/ubi9/openjdk-17-runtime:1.20
1+
FROM registry.access.redhat.com/ubi9/openjdk-17-runtime:1.21
22

33
ENV LANG='en_US.UTF-8' LANGUAGE='en_US:en'
44

0 commit comments

Comments
 (0)