From aef3dc95fc2e181e9c0b56979b882f9fece99af1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Chris=20Suszy=C5=84ski?= Date: Wed, 19 Apr 2023 20:55:12 +0200 Subject: [PATCH] Restore the Quarkus Micro Base Image name --- .github/workflows/build-images.yml | 2 -- quarkus-micro-base-image/pom.xml | 3 ++- .../src/main/java/io/quarkus/images/Build.java | 5 ++++- .../src/main/java/io/quarkus/images/Push.java | 5 ++++- .../src/main/java/io/quarkus/images/QuarkusMicro.java | 5 ++++- 5 files changed, 14 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build-images.yml b/.github/workflows/build-images.yml index ee51791d..2f4e6e97 100644 --- a/.github/workflows/build-images.yml +++ b/.github/workflows/build-images.yml @@ -5,8 +5,6 @@ on: branches: - main push: - branches: - - main paths-ignore: - '.build/**' diff --git a/quarkus-micro-base-image/pom.xml b/quarkus-micro-base-image/pom.xml index f36ab4ca..30e4259c 100644 --- a/quarkus-micro-base-image/pom.xml +++ b/quarkus-micro-base-image/pom.xml @@ -34,7 +34,8 @@ --dockerfile-dir=${pom.basedir}/target/docker --ubi-minimal=${ubi-min.base} --ubi-micro=${ubi-micro.base} - --out=quay.io/quarkus/${ubi.tag}-quarkus-micro-image:2.0 + --ubi-tag=${ubi.tag} + --out=quay.io/quarkus/quarkus-micro-image:2.0 --dry-run=${jdock.dry-run} diff --git a/quarkus-micro-base-image/src/main/java/io/quarkus/images/Build.java b/quarkus-micro-base-image/src/main/java/io/quarkus/images/Build.java index 99c929c0..b7f8be85 100644 --- a/quarkus-micro-base-image/src/main/java/io/quarkus/images/Build.java +++ b/quarkus-micro-base-image/src/main/java/io/quarkus/images/Build.java @@ -18,6 +18,9 @@ public class Build implements Callable { @CommandLine.Option(names = { "--ubi-micro" }, description = "The UBI Micro base image") private String micro; + @CommandLine.Option(names = { "--ubi-tag" }, description = "The tag to add to the output image tag") + private String ubiTag; + @CommandLine.Option(names = { "--out" }, description = "The output image") private String output; @@ -31,7 +34,7 @@ public class Build implements Callable { @Override public Integer call() throws Exception { JDock.setDockerFileDir(dockerFileDir); - QuarkusMicro.define(minimal, micro, output) + QuarkusMicro.define(minimal, micro, output, ubiTag) .buildLocalImages(dryRun); return 0; diff --git a/quarkus-micro-base-image/src/main/java/io/quarkus/images/Push.java b/quarkus-micro-base-image/src/main/java/io/quarkus/images/Push.java index 99acb97f..af73c637 100644 --- a/quarkus-micro-base-image/src/main/java/io/quarkus/images/Push.java +++ b/quarkus-micro-base-image/src/main/java/io/quarkus/images/Push.java @@ -18,6 +18,9 @@ public class Push implements Callable { @CommandLine.Option(names = { "--ubi-micro" }, description = "The UBI Micro base image") private String micro; + @CommandLine.Option(names = { "--ubi-tag" }, description = "The tag to add to the output image tag") + private String ubiTag; + @CommandLine.Option(names = { "--out" }, description = "The output image") private String output; @@ -31,7 +34,7 @@ public class Push implements Callable { @Override public Integer call() throws Exception { JDock.setDockerFileDir(dockerFileDir); - QuarkusMicro.define(minimal, micro, output) + QuarkusMicro.define(minimal, micro, output, ubiTag) .buildAndPush(); return 0; } diff --git a/quarkus-micro-base-image/src/main/java/io/quarkus/images/QuarkusMicro.java b/quarkus-micro-base-image/src/main/java/io/quarkus/images/QuarkusMicro.java index 06282057..326b28da 100644 --- a/quarkus-micro-base-image/src/main/java/io/quarkus/images/QuarkusMicro.java +++ b/quarkus-micro-base-image/src/main/java/io/quarkus/images/QuarkusMicro.java @@ -4,7 +4,7 @@ public class QuarkusMicro { - static MultiArchImage define(String minimal, String micro, String output) { + static MultiArchImage define(String minimal, String micro, String output, String ubiTag) { MultiStageDockerFile img = Dockerfile.multistages() .stage("ubi", Dockerfile.from(minimal)) .stage("scratch", Dockerfile.from(micro)) @@ -12,6 +12,9 @@ static MultiArchImage define(String minimal, String micro, String output) { .copyFromStage("ubi", "/usr/lib64/libgcc_s.so.1") .copyFromStage("ubi", "/usr/lib64/libstdc++.so.6") .copyFromStage("ubi", "/usr/lib64/libz.so.1")); + if (!"ubi".equals(ubiTag)) { + output = output + '-' + ubiTag; + } return new MultiArchImage(output, Map.of( "arm64", img, "amd64", img));