From 42b6ef2a958660f20a1962f069400addea3c91b2 Mon Sep 17 00:00:00 2001 From: Georgios Andrianakis Date: Mon, 30 Aug 2021 17:02:38 +0300 Subject: [PATCH] Use the proper config values when pulling base image for native build using Jib Fixes: #19771 (cherry picked from commit e419671f069e69baec3227d87c218b68d702d2c1) --- .../container/image/jib/deployment/JibProcessor.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/extensions/container-image/container-image-jib/deployment/src/main/java/io/quarkus/container/image/jib/deployment/JibProcessor.java b/extensions/container-image/container-image-jib/deployment/src/main/java/io/quarkus/container/image/jib/deployment/JibProcessor.java index 83e01cdd95028..5b6dd13883442 100644 --- a/extensions/container-image/container-image-jib/deployment/src/main/java/io/quarkus/container/image/jib/deployment/JibProcessor.java +++ b/extensions/container-image/container-image-jib/deployment/src/main/java/io/quarkus/container/image/jib/deployment/JibProcessor.java @@ -161,7 +161,7 @@ public void buildFromNative(ContainerImageConfig containerImageConfig, JibConfig "The native binary produced by the build is not a Linux binary and therefore cannot be used in a Linux container image. Consider adding \"quarkus.native.container-build=true\" to your configuration"); } - JibContainerBuilder jibContainerBuilder = createContainerBuilderFromNative(containerImageConfig, jibConfig, + JibContainerBuilder jibContainerBuilder = createContainerBuilderFromNative(jibConfig, nativeImage, containerImageLabels); setUser(jibConfig, jibContainerBuilder); setPlatforms(jibConfig, jibContainerBuilder); @@ -517,7 +517,7 @@ private JibContainerBuilder createContainerBuilderFromLegacyJar(JibConfig jibCon } } - private JibContainerBuilder createContainerBuilderFromNative(ContainerImageConfig containerImageConfig, JibConfig jibConfig, + private JibContainerBuilder createContainerBuilderFromNative(JibConfig jibConfig, NativeImageBuildItem nativeImageBuildItem, List containerImageLabels) { List entrypoint; @@ -532,8 +532,8 @@ private JibContainerBuilder createContainerBuilderFromNative(ContainerImageConfi try { AbsoluteUnixPath workDirInContainer = AbsoluteUnixPath.get("/work"); JibContainerBuilder jibContainerBuilder = Jib - .from(toRegistryImage(ImageReference.parse(jibConfig.baseNativeImage), containerImageConfig.username, - containerImageConfig.password)) + .from(toRegistryImage(ImageReference.parse(jibConfig.baseNativeImage), jibConfig.baseRegistryUsername, + jibConfig.baseRegistryPassword)) .addFileEntriesLayer(FileEntriesLayer.builder() .addEntry(nativeImageBuildItem.getPath(), workDirInContainer.resolve(BINARY_NAME_IN_CONTAINER), FilePermissions.fromOctalString("775"))