Skip to content

Commit

Permalink
Use the proper config values when pulling base image for native build…
Browse files Browse the repository at this point in the history
… using Jib

Fixes: quarkusio#19771
  • Loading branch information
geoand committed Aug 30, 2021
1 parent 2d1ece2 commit e419671
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -517,7 +517,7 @@ private JibContainerBuilder createContainerBuilderFromLegacyJar(JibConfig jibCon
}
}

private JibContainerBuilder createContainerBuilderFromNative(ContainerImageConfig containerImageConfig, JibConfig jibConfig,
private JibContainerBuilder createContainerBuilderFromNative(JibConfig jibConfig,
NativeImageBuildItem nativeImageBuildItem, List<ContainerImageLabelBuildItem> containerImageLabels) {

List<String> entrypoint;
Expand All @@ -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"))
Expand Down

0 comments on commit e419671

Please sign in to comment.