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 8ffa9ce8b0e42..23e4fabb07033 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 @@ -162,4 +162,11 @@ public class JibConfig { */ @ConfigItem(defaultValue = "false") public boolean offlineMode; + + /** + * Name of binary used to execute the docker commands. This is only used by Jib + * when the container image is being built locally. + */ + @ConfigItem + public Optional dockerExecutableName; } 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 ab11cca3cf94c..631fb799bb175 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 @@ -24,6 +24,7 @@ import java.util.stream.Collectors; import java.util.stream.Stream; +import org.eclipse.microprofile.config.ConfigProvider; import org.jboss.logging.Logger; import com.google.cloud.tools.jib.api.Containerizer; @@ -210,7 +211,16 @@ private Containerizer createContainerizer(ContainerImageConfig containerImageCon containerImageConfig.password); containerizer = Containerizer.to(registryImage); } else { - containerizer = Containerizer.to(DockerDaemonImage.named(imageReference)); + DockerDaemonImage dockerDaemonImage = DockerDaemonImage.named(imageReference); + Optional dockerConfigExecutableName = ConfigProvider.getConfig() + .getOptionalValue("quarkus.docker.executable-name", String.class); + Optional jibConfigExecutableName = jibConfig.dockerExecutableName; + if (jibConfigExecutableName.isPresent()) { + dockerDaemonImage.setDockerExecutable(Paths.get(jibConfigExecutableName.get())); + } else if (dockerConfigExecutableName.isPresent()) { + dockerDaemonImage.setDockerExecutable(Paths.get(dockerConfigExecutableName.get())); + } + containerizer = Containerizer.to(dockerDaemonImage); } containerizer.setToolName("Quarkus"); containerizer.setToolVersion(Version.getVersion());