Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide proper Docker executable name on Windows #32138

Merged
merged 2 commits into from
Mar 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions core/runtime/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@
<groupId>jakarta.inject</groupId>
<artifactId>jakarta.inject-api</artifactId>
</dependency>
<dependency>
<groupId>io.smallrye.common</groupId>
<artifactId>smallrye-common-os</artifactId>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-ide-launcher</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
import org.eclipse.microprofile.config.ConfigProvider;
import org.jboss.logging.Logger;

import io.smallrye.common.os.OS;
import io.smallrye.config.SmallRyeConfig;

public final class ContainerRuntimeUtil {
Expand Down Expand Up @@ -192,18 +193,24 @@ private static boolean getRootlessStateFor(ContainerRuntime containerRuntime) {
* Supported Container runtimes
*/
public enum ContainerRuntime {
DOCKER,
PODMAN,
UNAVAILABLE;
DOCKER("docker" + (OS.current() == OS.WINDOWS ? ".exe" : "")),
PODMAN("podman" + (OS.current() == OS.WINDOWS ? ".exe" : "")),
UNAVAILABLE(null);

private Boolean rootless;

private String executableName;

ContainerRuntime(String executableName) {
this.executableName = executableName;
}

public String getExecutableName() {
if (this == UNAVAILABLE) {
throw new IllegalStateException("Cannot get an executable name when no container runtime is available");
}

return this.name().toLowerCase();
return executableName;
}

public boolean isRootless() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,6 @@
#Wed Jan 23 12:03:29 AEDT 2019
0=java
1=javax
2=org
3=com
2=jakarta
3=org
4=com