Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
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
2 changes: 2 additions & 0 deletions docs/notes/2.34.x.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ Thank you to [Klaviyo](https://www.klaviyo.com/) for their Platinum tier support

Fixed a bug where `SingleSourceField` could not be hydrated for generated targets because files were validated before code generation ran.

The Rust engine now automatically falls back to common Podman socket paths (rootless and rootful) for `docker_environments` if the default Docker socket is unavailable.

### Goals

### Backends
Expand Down
25 changes: 23 additions & 2 deletions src/rust/process_execution/docker/src/docker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,29 @@ impl DockerOnceCell {
self
.cell
.get_or_try_init(async move {
let docker = Docker::connect_with_local_defaults()
.map_err(|err| format!("Failed to connect to local Docker: {err}"))?;
let docker = Docker::connect_with_local_defaults().or_else(|original_err| {
if let Ok(xdg) = std::env::var("XDG_RUNTIME_DIR") {
let podman_sock = format!("{}/podman/podman.sock", xdg);
if std::path::Path::new(&podman_sock).exists() {
let podman_uri = format!("unix://{}", podman_sock);
return Docker::connect_with_socket(
&podman_uri,
120,
bollard::API_DEFAULT_VERSION
);
}
}

if std::path::Path::new("/run/podman/podman.sock").exists() {
return Docker::connect_with_socket(
"unix:///run/podman/podman.sock",
120,
bollard::API_DEFAULT_VERSION
);
}

Err(original_err)
}).map_err(|err| format!("Failed to connect to local Docker/Podman: {err}"))?;

let version = docker.version().await
.map_err(|err| format!("Failed to obtain version from local Docker: {err}"))?;
Expand Down
Loading