Bollard treats Podman as a first-class container runtime alongside Docker. TheDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/fussybeaver/bollard/llms.txt
Use this file to discover all available pages before exploring further.
connect_with_podman_defaults method performs automatic socket discovery for both rootless and system (rootful) Podman installations, so you rarely need to specify socket paths manually.
connect_with_podman_defaults is currently Unix only. The pipe feature flag (enabled by default) is required.Docker::connect_with_podman_defaults
Probes a prioritised list of well-known socket locations and connects to the first one that exists on the filesystem.
Function signature
Socket Discovery Order
The method walks through the following candidates in order and uses the first socket that exists:$DOCKER_HOST (explicit override)
If the
DOCKER_HOST environment variable is set and starts with unix://, it is used directly — no filesystem probe is performed.$XDG_RUNTIME_DIR/podman/podman.sock (rootless, preferred)
The canonical rootless socket. Requires
XDG_RUNTIME_DIR to be set — most systemd-based Linux distributions set this automatically at login./run/user/$UID/podman/podman.sock (rootless fallback)
Constructed at runtime by substituting the current process’s UID. Used when
XDG_RUNTIME_DIR is unset or does not contain a Podman socket./run/podman/podman.sock (system / rootful)
The system-wide Podman socket, typically owned by root or the
podman group. Requires appropriate group membership or sudo.Feature Flag
This method requires the To use a minimal build with only Podman socket support:
pipe feature, which is enabled by default. No extra configuration is needed for most projects.Overriding the Socket at Runtime
Complete Example
Start the Podman socket service
On systemd-based Linux distributions, enable the Podman socket for your user:Or for the system-wide (rootful) socket:
Podman vs Docker Socket
Because Bollard uses the Docker-compatible REST API that Podman exposes, theDocker struct works identically against both runtimes. connect_with_podman_defaults simply ensures the right socket is selected on Podman-only hosts. All other Bollard APIs — containers, images, volumes, networks — work without modification.
connect_with_podman_defaults
Best choice when targeting hosts that may run Podman, rootless Podman, or a Podman-to-Docker socket shim. Performs automatic discovery with Docker fallback.
connect_with_local_defaults
Best choice when targeting standard Docker installations. Uses
DOCKER_HOST / context resolution and defaults to /var/run/docker.sock.