From 3f63d8d08bea05668dab62349c07334f95eb52f9 Mon Sep 17 00:00:00 2001 From: Clement Escoffier Date: Mon, 22 Nov 2021 20:57:48 +0100 Subject: [PATCH] Switch the base image for the container running the native executable to quay.io/quarkus/quarkus-micro-image:1.0 --- .../main/asciidoc/building-native-image.adoc | 21 ++++++++++--------- .../image/jib/deployment/JibConfig.java | 2 +- .../quarkus/tooling/dockerfiles/codestart.yml | 2 +- .../QuarkusCodestartGenerationTest.java | 4 ++-- 4 files changed, 15 insertions(+), 14 deletions(-) diff --git a/docs/src/main/asciidoc/building-native-image.adoc b/docs/src/main/asciidoc/building-native-image.adoc index 4141c4b59153a..28d39561c4785 100644 --- a/docs/src/main/asciidoc/building-native-image.adoc +++ b/docs/src/main/asciidoc/building-native-image.adoc @@ -458,7 +458,7 @@ The project generation has provided a `Dockerfile.native` in the `src/main/docke [source,dockerfile] ---- -FROM registry.access.redhat.com/ubi8/ubi-minimal +FROM quay.io/quarkus/quarkus-micro-image:1.0 WORKDIR /work/ COPY target/*-runner /work/application RUN chmod 775 /work @@ -467,17 +467,18 @@ CMD ["./application", "-Dquarkus.http.host=0.0.0.0"] ---- [NOTE] -.Ubi? +.Quarkus Micro Image? ==== -The provided `Dockerfiles` use https://access.redhat.com/containers/?tab=overview#/registry.access.redhat.com/ubi8/ubi[UBI] (Universal Base Image) as parent image. +The Quarkus Micro Image is a small container image providing the right set of dependencies to run your native application. +It is based on https://catalog.redhat.com/software/containers/ubi8-micro/601a84aadd19c7786c47c8ea?container-tabs=overview[UBI Micro]. This base image has been tailored to work perfectly in containers. -The `Dockerfiles` use the https://access.redhat.com/containers/#/registry.access.redhat.com/ubi8/ubi-minimal[_minimal_ version] of the base image to reduce the size of the produced image. -You can read more about UBI on: +You can read more about UBI images on: -* https://access.redhat.com/containers/?tab=overview#/registry.access.redhat.com/ubi8/ubi[the UBI image page] -* https://access.redhat.com/containers/#/registry.access.redhat.com/ubi8/ubi-minimal[the _UBI-minimal_ image page] -* https://access.redhat.com/containers/?tab=tags#/registry.access.redhat.com/ubi8/ubi-minimal[the list of _UBI-minimal_ tags] +* https://www.redhat.com/en/blog/introducing-red-hat-universal-base-image[Introduction to Universal Base Image] +* https://catalog.redhat.com/software/container-stacks/detail/5ec53f50ef29fd35586d9a56[Red Hat Universal Base Image 8] + +UBI images can be used without any limitations. ==== Then, if you didn't delete the generated native executable, you can build the docker image with: @@ -523,7 +524,7 @@ COPY src /code/src RUN ./mvnw package -Pnative ## Stage 2 : create the docker final image -FROM registry.access.redhat.com/ubi8/ubi-minimal:8.4 +FROM quay.io/quarkus/quarkus-micro-image:1.0 WORKDIR /work/ COPY --from=build /code/target/*-runner /work/application @@ -562,7 +563,7 @@ COPY src /code/src RUN gradle -b /code/build.gradle buildNative ## Stage 2 : create the docker final image -FROM registry.access.redhat.com/ubi8/ubi-minimal +FROM quay.io/quarkus/quarkus-micro-image:1.0 WORKDIR /work/ COPY --from=build /code/build/*-runner /work/application RUN chmod 775 /work diff --git a/extensions/container-image/container-image-jib/deployment/src/main/java/io/quarkus/container/image/jib/deployment/JibConfig.java b/extensions/container-image/container-image-jib/deployment/src/main/java/io/quarkus/container/image/jib/deployment/JibConfig.java index f8f74492a5979..8ffa9ce8b0e42 100644 --- a/extensions/container-image/container-image-jib/deployment/src/main/java/io/quarkus/container/image/jib/deployment/JibConfig.java +++ b/extensions/container-image/container-image-jib/deployment/src/main/java/io/quarkus/container/image/jib/deployment/JibConfig.java @@ -21,7 +21,7 @@ public class JibConfig { /** * The base image to be used when a container image is being produced for the native binary build */ - @ConfigItem(defaultValue = "registry.access.redhat.com/ubi8/ubi-minimal") + @ConfigItem(defaultValue = "quay.io/quarkus/quarkus-micro-image:1.0") public String baseNativeImage; /** diff --git a/independent-projects/tools/base-codestarts/src/main/resources/codestarts/quarkus/tooling/dockerfiles/codestart.yml b/independent-projects/tools/base-codestarts/src/main/resources/codestarts/quarkus/tooling/dockerfiles/codestart.yml index 3a09f50daef71..dcce266001179 100644 --- a/independent-projects/tools/base-codestarts/src/main/resources/codestarts/quarkus/tooling/dockerfiles/codestart.yml +++ b/independent-projects/tools/base-codestarts/src/main/resources/codestarts/quarkus/tooling/dockerfiles/codestart.yml @@ -13,6 +13,6 @@ language: java-package: java-11-openjdk-headless run-java-version: 1.3.8 native: - from: registry.access.redhat.com/ubi8/ubi-minimal:8.4 + from: quay.io/quarkus/quarkus-micro-image:1.0 native-distroless: from: quay.io/quarkus/quarkus-distroless-image:1.0 diff --git a/independent-projects/tools/devtools-testing/src/test/java/io/quarkus/devtools/codestarts/quarkus/QuarkusCodestartGenerationTest.java b/independent-projects/tools/devtools-testing/src/test/java/io/quarkus/devtools/codestarts/quarkus/QuarkusCodestartGenerationTest.java index e2e14b2015808..1cf04f5f86fa8 100644 --- a/independent-projects/tools/devtools-testing/src/test/java/io/quarkus/devtools/codestarts/quarkus/QuarkusCodestartGenerationTest.java +++ b/independent-projects/tools/devtools-testing/src/test/java/io/quarkus/devtools/codestarts/quarkus/QuarkusCodestartGenerationTest.java @@ -288,7 +288,7 @@ private void checkDockerfilesWithMaven(Path projectDir) { .satisfies(checkContains("ENTRYPOINT [ \"/deployments/run-java.sh\" ]")); assertThat(projectDir.resolve("src/main/docker/Dockerfile.native")).exists() .satisfies(checkContains("./mvnw package -Pnative")) - .satisfies(checkContains("registry.access.redhat.com/ubi8/ubi-minimal:8.4")) + .satisfies(checkContains("quay.io/quarkus/quarkus-micro-image:1.0")) .satisfies(checkContains("CMD [\"./application\", \"-Dquarkus.http.host=0.0.0.0\"]")); } @@ -308,7 +308,7 @@ private void checkDockerfilesWithGradle(Path projectDir) { .satisfies(checkContains("ENTRYPOINT [ \"/deployments/run-java.sh\" ]")); assertThat(projectDir.resolve("src/main/docker/Dockerfile.native")).exists() .satisfies(checkContains("./gradlew build -Dquarkus.package.type=native")) - .satisfies(checkContains("registry.access.redhat.com/ubi8/ubi-minimal:8.4")) + .satisfies(checkContains("quay.io/quarkus/quarkus-micro-image:1.0")) .satisfies(checkContains("CMD [\"./application\", \"-Dquarkus.http.host=0.0.0.0\"]")); }