Skip to content
Open
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
1 change: 1 addition & 0 deletions docs/notes/2.34.x.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ Fixed an issue where `pants --changed-since` would unnecessarily invalidate all

The `indicatif-spinner` `dynamic_ui_renderer` (default), now renders on a dedicated thread. This should reduce jitter and display a smoother spinner under heavy load.

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

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