Skip to content

Commit

Permalink
Fix Podman detection on Windows
Browse files Browse the repository at this point in the history
Fixes #32106

(cherry picked from commit 82e62c7)
  • Loading branch information
gsmet committed Apr 2, 2023
1 parent b3b3ec3 commit 54e6bdd
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -76,15 +76,17 @@ public static ContainerRuntime detectContainerRuntime(boolean required) {
dockerAvailable = dockerVersionOutput.contains("Docker version");
if (dockerAvailable) {
// Check if "docker" is an alias to "podman"
if (dockerVersionOutput.startsWith("podman version")) {
if (dockerVersionOutput.startsWith("podman version") ||
dockerVersionOutput.startsWith("podman.exe version")) {
storeContainerRuntimeInSystemProperty(ContainerRuntime.PODMAN);
return ContainerRuntime.PODMAN;
}
storeContainerRuntimeInSystemProperty(ContainerRuntime.DOCKER);
return ContainerRuntime.DOCKER;
}
podmanVersionOutput = getVersionOutputFor(ContainerRuntime.PODMAN);
podmanAvailable = podmanVersionOutput.startsWith("podman version");
podmanAvailable = podmanVersionOutput.startsWith("podman version") ||
podmanVersionOutput.startsWith("podman.exe version");
if (podmanAvailable) {
storeContainerRuntimeInSystemProperty(ContainerRuntime.PODMAN);
return ContainerRuntime.PODMAN;
Expand Down

0 comments on commit 54e6bdd

Please sign in to comment.