fix(rust): add fallback to Podman sockets for docker_environments#23520
fix(rust): add fallback to Podman sockets for docker_environments#23520thiago-carbonera wants to merge 2 commits into
Conversation
|
Thanks for the PR, but I don't think this is the right approach. A quick glance at the bollard changelogs shows that they seem to have been improving their Podman support. For example: fussybeaver/bollard#700 I think the fundamental issue is that our Bollard dep is 1.5 years old. |
tdyas
left a comment
There was a problem hiding this comment.
Does podman work with docker_environment if you just upgrade the bollard crate?
|
Hi @tdyas and @sureshjoshi! I just bumped the bollard workspace dependency to 0.21.0 locally to test this approach. |
|
What version of bollard was the podman support added in? And how much "churn" is there in bollard for that version (versus upgrading all the way to 0.21.x)? |
|
Hi @tdyas! I just checked the bollard release notes, and the 'first-class Podman support' was introduced exactly in version 0.21.0. Because it was only added in 0.21.0, there isn't an intermediate version we can upgrade to. |
|
I also think @thiago-carbonera you need to consider dialing back how much you allow an LLM to speak for you, if you are. If you're not I apologize in advance. |
Fixes #22936.
Problem
Currently, users utilizing Podman for
docker_environmentsface connection errors because the Rust engine (using the Bollard client) strictly defaults to the standard Docker socket (/var/run/docker.sock). When this socket is not found, the execution fails, forcing users to manually set theDOCKER_HOSTenvironment variable to point to their Podman socket.Solution
This PR introduces a fallback mechanism when initializing the Docker client in
docker.rs:Rootless Podman:
$XDG_RUNTIME_DIR/podman/podman.sockRootful Podman:
/run/podman/podman.sockDocker::connect_with_socket.This eliminates the need for manual workarounds and provides out-of-the-box support for Podman users.