Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update the Quarkus images to multi-archs variants #27997

Merged
merged 1 commit into from
Sep 19, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.2-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:22.2-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.2-java17";
public static final String DEFAULT_MANDREL_BUILDER_IMAGE = "quay.io/quarkus/ubi-quarkus-mandrel:22.2-java17";
public static final String DEFAULT_GRAALVM_BUILDER_IMAGE = "quay.io/quarkus/ubi-quarkus-graalvmce-builder-image:22.2-java17";
public static final String DEFAULT_MANDREL_BUILDER_IMAGE = "quay.io/quarkus/ubi-quarkus-mandrel-builder-image:22.2-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.2-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 @@ -576,7 +576,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
30 changes: 15 additions & 15 deletions docs/src/main/asciidoc/building-native-image.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -399,15 +399,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 @@ -454,7 +454,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 @@ -499,7 +499,7 @@ The project generation has also provided a `Dockerfile.native` in the `src/main/

[source,dockerfile]
----
FROM registry.access.redhat.com/ubi8/ubi-minimal:8.5
FROM registry.access.redhat.com/ubi8/ubi-minimal:8.6
WORKDIR /work/
COPY target/*-runner /work/application
RUN chmod 775 /work
Expand Down Expand Up @@ -528,7 +528,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 @@ -539,7 +539,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 @@ -566,7 +566,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 @@ -580,7 +580,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 @@ -614,8 +614,8 @@ If you need SSL support in your native executable, you can easily include the ne
Please see xref:native-and-ssl.adoc#working-with-containers[our Using SSL With Native Executables guide] for more information.
====

NOTE: To use Mandrel instead of GraalVM CE, update the `FROM` clause to: `FROM quay.io/quarkus/ubi-quarkus-mandrel:$TAG AS build`.
`$TAG` can be found on the https://quay.io/repository/quarkus/ubi-quarkus-mandrel?tab=tags[Quarkus Mandrel Images Tags page].
NOTE: To use Mandrel instead of GraalVM CE, update the `FROM` clause to: `FROM quay.io/quarkus/ubi-quarkus-mandrel-builder-image:$TAG AS build`.
`$TAG` can be found on the https://quay.io/repository/quarkus/ubi-quarkus-mandrel-builder-image?tab=tags[Quarkus Mandrel Images Tags page].

=== Using a Distroless base image

Expand All @@ -629,7 +629,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 @@ -638,7 +638,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 @@ -655,7 +655,7 @@ Sample multistage Dockerfile for building an image from `scratch`:
[source, dockerfile]
----
## Stage 1 : build with maven builder image with native capabilities
FROM quay.io/quarkus/ubi-quarkus-native-image:22.0-java11 AS build
FROM quay.io/quarkus/ubi-quarkus-graalvmce-builder-image:22.2-java11 AS build
USER root
RUN microdnf install make gcc
COPY --chown=quarkus:quarkus mvnw /code/mvnw
Expand Down Expand Up @@ -739,13 +739,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 @@ -403,13 +403,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 @@ -420,13 +420,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 @@ -449,12 +449,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
2 changes: 1 addition & 1 deletion docs/src/main/asciidoc/kotlin.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ include::{includes}/prerequisites.adoc[]

[WARNING]
====
If building with Mandrel, make sure to use version Mandrel 22.1 or above, for example `ubi-quarkus-mandrel:22.1-java17`.
If building with Mandrel, make sure to use version Mandrel 22.1 or above, for example `ubi-quarkus-mandrel-builder-image:{mandrel-flavor}`.
With older versions, you might encounter errors when trying to deserialize JSON documents that have null or missing fields, similar to the errors mentioned in the <<kotlin-jackson>> section.
====

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 @@ -430,12 +430,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 @@ -487,7 +487,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 @@ -1603,7 +1603,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 @@ -127,7 +127,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
Loading