Skip to content

Commit

Permalink
Update the Quarkus images to multi-archs variants
Browse files Browse the repository at this point in the history
- the builder images are now: quarkusubi-quarkus-graalvmce-builder-image and quarkusubi-quarkus-mandrel-builder-image. Both at multi-archs (AMD64 and ARM64).
- the s2i images are now: quarkusubi-quarkus-native-binary-s2i:2.0 and quarkusubi-quarkus-graalvmce-s2i
- the base images are now: quarkusquarkus-micro-image:2.0 and quarkusquarkus-distroless-image:2.0
  • Loading branch information
cescoffier authored and gsmet committed May 15, 2023
1 parent 32fcdc6 commit 034a084
Show file tree
Hide file tree
Showing 20 changed files with 57 additions and 54 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/native-cron-build.yml.disabled
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
run: sudo systemctl stop mysql

- name: Pull docker image
run: docker pull quay.io/quarkus/ubi-quarkus-native-image:20.2.0-java${{ matrix.java }}
run: docker pull quay.io/quarkus/ubi-quarkus-graalvmce-builder-image:22.3-java${{ matrix.java }}

- name: Set up JDK ${{ matrix.java }}
uses: actions/setup-java@v2
Expand Down Expand Up @@ -55,7 +55,7 @@ jobs:
run: ./mvnw -B install -DskipTests -DskipITs -Dformat.skip

- name: Run integration tests in native
run: ./mvnw -B --settings .github/mvn-settings.xml verify -f integration-tests/pom.xml --fail-at-end -Dno-format -Dtest-containers -Dstart-containers -Dnative -Dquarkus.native.container-build=true -Dquarkus.native.builder-image=quay.io/quarkus/ubi-quarkus-native-image:20.2.0-java${{ matrix.java }} -pl '!io.quarkus:quarkus-integration-test-google-cloud-functions-http,!io.quarkus:quarkus-integration-test-google-cloud-functions,!io.quarkus:quarkus-integration-test-funqy-google-cloud-functions'
run: ./mvnw -B --settings .github/mvn-settings.xml verify -f integration-tests/pom.xml --fail-at-end -Dno-format -Dtest-containers -Dstart-containers -Dnative -Dquarkus.native.container-build=true -Dquarkus.native.builder-image=quay.io/quarkus/ubi-quarkus-graalvmce-builder-image:20.2.0-java${{ matrix.java }} -pl '!io.quarkus:quarkus-integration-test-google-cloud-functions-http,!io.quarkus:quarkus-integration-test-google-cloud-functions,!io.quarkus:quarkus-integration-test-funqy-google-cloud-functions'

- name: Report
if: always()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
@ConfigRoot(phase = ConfigPhase.BUILD_TIME)
public class NativeConfig {

public static final String DEFAULT_GRAALVM_BUILDER_IMAGE = "quay.io/quarkus/ubi-quarkus-native-image:22.3-java17";
public static final String DEFAULT_MANDREL_BUILDER_IMAGE = "quay.io/quarkus/ubi-quarkus-mandrel:22.3-java17";
public static final String DEFAULT_GRAALVM_BUILDER_IMAGE = "quay.io/quarkus/ubi-quarkus-graalvmce-builder-image:22.3-java17";
public static final String DEFAULT_MANDREL_BUILDER_IMAGE = "quay.io/quarkus/ubi-quarkus-mandrel-builder-image:22.3-java17";

/**
* Comma-separated, additional arguments to pass to the build process.
Expand Down Expand Up @@ -211,7 +211,7 @@ public boolean isContainerBuild() {

/**
* The docker image to use to do the image build. It can be one of `graalvm`, `mandrel`, or the full image path, e.g.
* {@code quay.io/quarkus/ubi-quarkus-mandrel:21.3-java17}.
* {@code quay.io/quarkus/ubi-quarkus-mandrel-builder-image:22.3-java17}.
*/
@ConfigItem(defaultValue = "${platform.quarkus.native.builder-image}")
public String builderImage;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,21 @@ class NativeConfigTest {

@Test
public void testBuilderImageProperlyDetected() {
assertThat(createConfig("graalvm").getEffectiveBuilderImage()).contains("ubi-quarkus-native-image")
assertThat(createConfig("graalvm").getEffectiveBuilderImage()).contains("ubi-quarkus-graalvmce-builder-image")
.contains("java17");
assertThat(createConfig("GraalVM").getEffectiveBuilderImage()).contains("ubi-quarkus-native-image")
assertThat(createConfig("GraalVM").getEffectiveBuilderImage()).contains("ubi-quarkus-graalvmce-builder-image")
.contains("java17");
assertThat(createConfig("GraalVM").getEffectiveBuilderImage()).contains("ubi-quarkus-native-image")
assertThat(createConfig("GraalVM").getEffectiveBuilderImage()).contains("ubi-quarkus-graalvmce-builder-image")
.contains("java17");
assertThat(createConfig("GRAALVM").getEffectiveBuilderImage()).contains("ubi-quarkus-native-image")
assertThat(createConfig("GRAALVM").getEffectiveBuilderImage()).contains("ubi-quarkus-graalvmce-builder-image")
.contains("java17");

assertThat(createConfig("mandrel").getEffectiveBuilderImage()).contains("ubi-quarkus-mandrel").contains("java17");
assertThat(createConfig("Mandrel").getEffectiveBuilderImage()).contains("ubi-quarkus-mandrel").contains("java17");
assertThat(createConfig("MANDREL").getEffectiveBuilderImage()).contains("ubi-quarkus-mandrel").contains("java17");
assertThat(createConfig("mandrel").getEffectiveBuilderImage()).contains("ubi-quarkus-mandrel-builder-image")
.contains("java17");
assertThat(createConfig("Mandrel").getEffectiveBuilderImage()).contains("ubi-quarkus-mandrel-builder-image")
.contains("java17");
assertThat(createConfig("MANDREL").getEffectiveBuilderImage()).contains("ubi-quarkus-mandrel-builder-image")
.contains("java17");

assertThat(createConfig("aRandomString").getEffectiveBuilderImage()).isEqualTo("aRandomString");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ void testBuilderImageBeingPickedUp() {
command = localRunner.buildCommand("docker", Collections.emptyList(), Collections.emptyList());
found = false;
for (String part : command) {
if (part.contains("ubi-quarkus-native-image")) {
if (part.contains("ubi-quarkus-graalvmce-builder-image")) {
found = true;
}
}
Expand All @@ -39,7 +39,7 @@ void testBuilderImageBeingPickedUp() {
command = localRunner.buildCommand("docker", Collections.emptyList(), Collections.emptyList());
found = false;
for (String part : command) {
if (part.contains("ubi-quarkus-mandrel")) {
if (part.contains("ubi-quarkus-mandrel-builder-image")) {
found = true;
}
}
Expand Down
2 changes: 1 addition & 1 deletion docs/src/main/asciidoc/amazon-lambda.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -577,7 +577,7 @@ To extract the required ssl, you must start up a Docker container in the backgro
First, let's start the GraalVM container, noting the container id output.
[source,bash,subs=attributes+]
----
docker run -it -d --entrypoint bash quay.io/quarkus/ubi-quarkus-native-image:{graalvm-flavor}
docker run -it -d --entrypoint bash quay.io/quarkus/ubi-quarkus-graalvmce-builder-image:{graalvm-flavor}
# This will output a container id, like 6304eea6179522aff69acb38eca90bedfd4b970a5475aa37ccda3585bc2abdde
# Note this value as we will need it for the commands below
Expand Down
26 changes: 13 additions & 13 deletions docs/src/main/asciidoc/building-native-image.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -400,15 +400,15 @@ The reason for this is that the local build driver invoked through `-Dquarkus.na
====
Building with Mandrel requires a custom builder image parameter to be passed additionally:
:build-additional-parameters: -Dquarkus.native.builder-image=quay.io/quarkus/ubi-quarkus-mandrel:{mandrel-flavor}
:build-additional-parameters: -Dquarkus.native.builder-image=quay.io/quarkus/ubi-quarkus-mandrel-builder-image:{mandrel-flavor}
include::{includes}/devtools/build-native-container-parameters.adoc[]
:!build-additional-parameters:
Please note that the above command points to a floating tag.
It is highly recommended to use the floating tag,
so that your builder image remains up-to-date and secure.
If you absolutely must, you may hard-code to a specific tag
(see https://quay.io/repository/quarkus/ubi-quarkus-mandrel?tab=tags[here] for available tags),
(see https://quay.io/repository/quarkus/ubi-quarkus-mandrel-builder-image?tab=tags[here] for available tags),
but be aware that you won't get security updates that way and it's unsupported.
====

Expand Down Expand Up @@ -455,7 +455,7 @@ The project generation has provided a `Dockerfile.native-micro` in the `src/main

[source,dockerfile]
----
FROM quay.io/quarkus/quarkus-micro-image:1.0
FROM quay.io/quarkus/quarkus-micro-image:2.0
WORKDIR /work/
COPY target/*-runner /work/application
RUN chmod 775 /work
Expand Down Expand Up @@ -529,7 +529,7 @@ Sample Dockerfile for building with Maven:
[source,dockerfile,subs=attributes+]
----
## Stage 1 : build with maven builder image with native capabilities
FROM quay.io/quarkus/ubi-quarkus-native-image:{graalvm-flavor} AS build
FROM quay.io/quarkus/ubi-quarkus-graalvmce-builder-image:{graalvm-flavor} AS build
COPY --chown=quarkus:quarkus mvnw /code/mvnw
COPY --chown=quarkus:quarkus .mvn /code/.mvn
COPY --chown=quarkus:quarkus pom.xml /code/
Expand All @@ -540,7 +540,7 @@ COPY src /code/src
RUN ./mvnw package -Pnative
## Stage 2 : create the docker final image
FROM quay.io/quarkus/quarkus-micro-image:1.0
FROM quay.io/quarkus/quarkus-micro-image:2.0
WORKDIR /work/
COPY --from=build /code/target/*-runner /work/application
Expand All @@ -567,7 +567,7 @@ Sample Dockerfile for building with Gradle:
[source,dockerfile,subs=attributes+]
----
## Stage 1 : build with maven builder image with native capabilities
FROM quay.io/quarkus/ubi-quarkus-native-image:{graalvm-flavor} AS build
FROM quay.io/quarkus/ubi-quarkus-graalvmce-builder-image:{graalvm-flavor} AS build
USER root
RUN microdnf install findutils
COPY --chown=quarkus:quarkus gradlew /code/gradlew
Expand All @@ -581,7 +581,7 @@ COPY src /code/src
RUN ./gradlew build -Dquarkus.package.type=native
## Stage 2 : create the docker final image
FROM quay.io/quarkus/quarkus-micro-image:1.0
FROM quay.io/quarkus/quarkus-micro-image:2.0
WORKDIR /work/
COPY --from=build /code/build/*-runner /work/application
RUN chmod 775 /work
Expand Down Expand Up @@ -617,7 +617,7 @@ Please see xref:native-and-ssl.adoc#working-with-containers[our Using SSL With N

[NOTE,subs=attributes+]
====
To use Mandrel instead of GraalVM CE, update the `FROM` clause to: `FROM quay.io/quarkus/ubi-quarkus-mandrel-builder-image:{mandrel-flavor} AS build`.
To use Mandrel instead of GraalVM CE, update the `FROM` clause to: `FROM quay.io/quarkus/ubi-quarkus-mandrel-builder-image-builder-image:{mandrel-flavor} AS build`.
====

[NOTE]
Expand All @@ -637,7 +637,7 @@ You only need to copy your application, and you are done:

[source, dockerfile]
----
FROM quay.io/quarkus/quarkus-distroless-image:1.0
FROM quay.io/quarkus/quarkus-distroless-image:2.0
COPY target/*-runner /application
EXPOSE 8080
Expand All @@ -646,7 +646,7 @@ USER nonroot
CMD ["./application", "-Dquarkus.http.host=0.0.0.0"]
----

Quarkus provides the `quay.io/quarkus/quarkus-distroless-image:1.0` image.
Quarkus provides the `quay.io/quarkus/quarkus-distroless-image:2.0` image.
It contains the required packages to run a native executable and is only **9Mb**.
Just add your application on top of this image, and you will get a tiny container image.

Expand All @@ -663,7 +663,7 @@ Sample multistage Dockerfile for building an image from `scratch`:
[source,dockerfile,subs=attributes+]
----
## Stage 1 : build with maven builder image with native capabilities
FROM quay.io/quarkus/ubi-quarkus-native-image:{graalvm-flavor} AS build
FROM quay.io/quarkus/ubi-quarkus-graalvmce-builder-image:{graalvm-flavor} AS build
USER root
RUN microdnf install make gcc
COPY --chown=quarkus:quarkus mvnw /code/mvnw
Expand Down Expand Up @@ -747,13 +747,13 @@ docker run \
--v $(pwd):/work <1>
-w /work <2>
--entrypoint bin/sh \
quay.io/quarkus/ubi-quarkus-native-image:{graalvm-flavor} \ <3>
quay.io/quarkus/ubi-quarkus-graalvmce-builder-image:{graalvm-flavor} \ <3>
-c "native-image $(cat native-image.args) -J-Xmx4g" <4>
----

<1> Mount the host's directory `target/native-image` to the container's `/work`. Thus, the generated binary will also be written to this directory.
<2> Switch the working directory to `/work`, which we have mounted in <1>.
<3> Use the `quay.io/quarkus/ubi-quarkus-native-image:{graalvm-flavor}` docker image introduced in <<#multistage-docker,Using a multi-stage Docker build>> to build the native image.
<3> Use the `quay.io/quarkus/ubi-quarkus-graalvmce-builder-image:{graalvm-flavor}` docker image introduced in <<#multistage-docker,Using a multi-stage Docker build>> to build the native image.
<4> Call `native-image` with the content of file `native-image.args` as arguments. We also supply an additional argument to limit the process's maximum memory to 4 Gigabytes (this may vary depending on the project being built and the machine building it).

[WARNING]
Expand Down
12 changes: 6 additions & 6 deletions docs/src/main/asciidoc/gradle-tooling.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -404,13 +404,13 @@ Configuring the `quarkusBuild` task can be done as following:
quarkusBuild {
nativeArgs {
containerBuild = true <1>
builderImage = "quay.io/quarkus/ubi-quarkus-native-image:{graalvm-flavor}" <2>
builderImage = "quay.io/quarkus/ubi-quarkus-graalvmce-builder-image:{graalvm-flavor}" <2>
}
}
----
<1> Set `quarkus.native.container-build` property to `true`
<2> Set `quarkus.native.builder-image` property to `quay.io/quarkus/ubi-quarkus-native-image:{graalvm-flavor}`
<2> Set `quarkus.native.builder-image` property to `quay.io/quarkus/ubi-quarkus-graalvmce-builder-image:{graalvm-flavor}`
****

[role="secondary asciidoc-tabs-sync-kotlin"]
Expand All @@ -421,13 +421,13 @@ quarkusBuild {
tasks.quarkusBuild {
nativeArgs {
"container-build" to true <1>
"builder-image" to "quay.io/quarkus/ubi-quarkus-native-image:{graalvm-flavor}" <2>
"builder-image" to "quay.io/quarkus/ubi-quarkus-graalvmce-builder-image:{graalvm-flavor}" <2>
}
}
----
<1> Set `quarkus.native.container-build` property to `true`
<2> Set `quarkus.native.builder-image` property to `quay.io/quarkus/ubi-quarkus-native-image:{graalvm-flavor}`
<2> Set `quarkus.native.builder-image` property to `quay.io/quarkus/ubi-quarkus-graalvmce-builder-image:{graalvm-flavor}`
****

[WARNING]
Expand All @@ -450,12 +450,12 @@ Note that in this case the build itself runs in a Docker container too, so you d

[TIP]
====
By default, the native executable will be generated using the `quay.io/quarkus/ubi-quarkus-native-image:{graalvm-flavor}` Docker image.
By default, the native executable will be generated using the `quay.io/quarkus/ubi-quarkus-graalvmce-builder-image:{graalvm-flavor}` Docker image.
If you want to build a native executable with a different Docker image (for instance to use a different GraalVM version),
use the `-Dquarkus.native.builder-image=<image name>` build argument.
The list of the available Docker images can be found on https://quay.io/repository/quarkus/ubi-quarkus-native-image?tab=tags[quay.io].
The list of the available Docker images can be found on https://quay.io/repository/quarkus/ubi-quarkus-graalvmce-builder-image?tab=tags[quay.io].
Be aware that a given Quarkus version might not be compatible with all the images available.
====

Expand Down
4 changes: 2 additions & 2 deletions docs/src/main/asciidoc/maven-tooling.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -431,12 +431,12 @@ Note that in this case the build itself runs in a Docker container too, so you d

[TIP]
====
By default, the native executable will be generated using the `quay.io/quarkus/ubi-quarkus-native-image:{graalvm-flavor}` Docker image.
By default, the native executable will be generated using the `quay.io/quarkus/ubi-quarkus-graalvmce-builder-image:{graalvm-flavor}` Docker image.
If you want to build a native executable with a different Docker image (for instance to use a different GraalVM version),
use the `-Dquarkus.native.builder-image=<image name>` build argument.
The list of the available Docker images can be found on https://quay.io/repository/quarkus/ubi-quarkus-native-image?tab=tags[quay.io].
The list of the available Docker images can be found on https://quay.io/repository/quarkus/ubi-quarkus-graalvmce-builder-image?tab=tags[quay.io].
Be aware that a given Quarkus version might not be compatible with all the images available.
====

Expand Down
6 changes: 3 additions & 3 deletions docs/src/main/asciidoc/native-reference.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ So, go ahead and add the following options to that file:
[source,properties,subs=attributes+]
----
quarkus.native.container-build=true
quarkus.native.builder-image=quay.io/quarkus/ubi-quarkus-mandrel:{mandrel-flavor}
quarkus.native.builder-image=quay.io/quarkus/ubi-quarkus-mandrel-builder-image:{mandrel-flavor}
quarkus.container-image.build=true
quarkus.container-image.group=test
----
Expand Down Expand Up @@ -494,7 +494,7 @@ These are called expert options and you can learn more about them by running:

[source,bash,subs=attributes+]
----
docker run quay.io/quarkus/ubi-quarkus-mandrel:{mandrel-flavor} --expert-options-all
docker run quay.io/quarkus/ubi-quarkus-mandrel-builder-image:{mandrel-flavor} --expert-options-all
----

[WARNING]
Expand Down Expand Up @@ -1610,7 +1610,7 @@ E.g.
[source,bash,subs=attributes+]
----
./mvnw package -DskipTests -Dnative -Dquarkus.native.container-build=true \
-Dquarkus.native.builder-image=quay.io/quarkus/ubi-quarkus-mandrel:{mandrel-flavor} \
-Dquarkus.native.builder-image=quay.io/quarkus/ubi-quarkus-mandrel-builder-image:{mandrel-flavor} \
-Dquarkus.native.enable-vm-inspection=true
----

Expand Down
2 changes: 1 addition & 1 deletion docs/src/main/asciidoc/platform.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ A platform properties file for the example above would contain:

[source,text,subs=attributes+]
----
platform.quarkus.native.builder-image=quay.io/quarkus/ubi-quarkus-native-image:{graalvm-flavor}
platform.quarkus.native.builder-image=quay.io/quarkus/ubi-quarkus-graalvmce-builder-image:{graalvm-flavor}
----

There is also a Maven plugin goal that validates the platform properties content and its artifact coordinates and also checks whether the platform properties artifact is present in the platform's BOM. Here is a sample plugin configuration:
Expand Down
8 changes: 4 additions & 4 deletions docs/src/main/asciidoc/quarkus-runtime-base-image.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ https://github.com/quarkusio/quarkus/tree/main/docs/src/main/asciidoc
include::_attributes.adoc[]

To ease the containerization of native executables, Quarkus provides a base image providing the requirements to run these executables.
The `quarkus-micro-image:1.0` image is:
The `quarkus-micro-image:2.0` image is:

* small (based on `ubi8-micro`)
* designed for containers
Expand All @@ -21,7 +21,7 @@ In your `Dockerfile`, just use:

[source, dockerfile]
----
FROM quay.io/quarkus/quarkus-micro-image:1.0
FROM quay.io/quarkus/quarkus-micro-image:2.0
WORKDIR /work/
COPY target/*-runner /work/application
RUN chmod 775 /work
Expand All @@ -42,7 +42,7 @@ FROM registry.access.redhat.com/ubi8/ubi-minimal:8.6 as BUILD
RUN microdnf install freetype
# Second stage - copy the dependencies
FROM quay.io/quarkus/quarkus-micro-image:1.0
FROM quay.io/quarkus/quarkus-micro-image:2.0
COPY --from=BUILD \
/lib64/libfreetype.so.6 \
/lib64/libbz2.so.1 \
Expand All @@ -65,7 +65,7 @@ FROM registry.access.redhat.com/ubi8/ubi-minimal:8.6 as BUILD
RUN microdnf install freetype fontconfig
# Second stage - copy the dependencies
FROM quay.io/quarkus/quarkus-micro-image:1.0
FROM quay.io/quarkus/quarkus-micro-image:2.0
COPY --from=BUILD \
/lib64/libfreetype.so.6 \
/lib64/libgcc_s.so.1 \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public class JibConfig {
* "registry.access.redhat.com/ubi8/ubi-minimal" which is a bigger base image, but provide more built-in utilities
* such as the microdnf package manager.
*/
@ConfigItem(defaultValue = "quay.io/quarkus/quarkus-micro-image:1.0")
@ConfigItem(defaultValue = "quay.io/quarkus/quarkus-micro-image:2.0")
public String baseNativeImage;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
public enum OpenshiftBaseNativeImage {

//We only compare `repositories` so registries and tags are stripped
QUARKUS("quarkus/ubi-quarkus-native-binary-s2i:latest", "/home/quarkus/", "application", "QUARKUS_HOME", "QUARKUS_OPTS");
QUARKUS("quarkus/ubi-quarkus-native-binary-s2i:2.0", "/home/quarkus/", "application", "QUARKUS_HOME", "QUARKUS_OPTS");

private final String image;
private final String nativeBinaryDirectory;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public class OpenshiftConfig {

public static final String DEFAULT_BASE_JVM_JDK11_IMAGE = "registry.access.redhat.com/ubi8/openjdk-11:1.15";
public static final String DEFAULT_BASE_JVM_JDK17_IMAGE = "registry.access.redhat.com/ubi8/openjdk-17:1.15";
public static final String DEFAULT_BASE_NATIVE_IMAGE = "quay.io/quarkus/ubi-quarkus-native-binary-s2i:1.0";
public static final String DEFAULT_BASE_NATIVE_IMAGE = "quay.io/quarkus/ubi-quarkus-native-binary-s2i:2.0";
public static final String DEFAULT_NATIVE_TARGET_FILENAME = "application";

public static final String DEFAULT_JVM_DOCKERFILE = "src/main/docker/Dockerfile.jvm";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
public enum S2iBaseNativeImage {

//We only compare `repositories` so registries and tags are stripped
QUARKUS("quarkus/ubi-quarkus-native-binary-s2i:latest", "application", "QUARKUS_HOME", "QUARKUS_OPTS");
QUARKUS("quarkus/ubi-quarkus-native-binary-s2i:2.0", "application", "QUARKUS_HOME", "QUARKUS_OPTS");

private final String image;
private final String fixedNativeBinaryName;
Expand Down
Loading

0 comments on commit 034a084

Please sign in to comment.