Skip to content
Snippets Groups Projects
Unverified Commit cd5c765f authored by André Silva's avatar André Silva Committed by GitHub
Browse files

fix(docker): don't early exit if docker binary isn't available (#211)

parent e5cb1534
Branches
No related merge requests found
Pipeline #474666 passed with stage
in 18 minutes and 53 seconds
......@@ -186,21 +186,24 @@ impl DockerClient {
}
async fn is_using_podman() -> Result<bool> {
let result = tokio::process::Command::new("docker")
if let Ok(output) = tokio::process::Command::new("docker")
.arg("version")
.output()
.await
{
// detect whether we're actually running podman with docker emulation
return Ok(String::from_utf8_lossy(&output.stdout)
.to_lowercase()
.contains("podman"));
}
tokio::process::Command::new("podman")
.arg("--version")
.output()
.await
.map_err(|err| anyhow!("Failed to detect container engine: {err}"))?;
if !result.status.success() {
return Err(anyhow!(
"Failed to detect container engine: {}",
String::from_utf8_lossy(&result.stderr)
)
.into());
}
Ok(String::from_utf8_lossy(&result.stdout).contains("podman"))
Ok(true)
}
}
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment