testcontainers-go
testcontainers-go copied to clipboard
[Enhancement]: Use default docker host detection chain to auto-detect Podman
Proposal
The Podman detection relies on DOCKER_HOST but the env var might not always be set. For example, on macOS, there is a helper that symlinks /var/run/docker.sock to the Podman socket so setting DOCKER_HOST is not necessary.
To be more reliable the detection heuristic should lean on the default host detection, which also checks the testcontainer config and even could be extended to resolve the symlinked socket location to detect the use of Podman.
I already played around with these ideas and am happy to provide a PR if you also think this makes sense.
Related: https://github.com/testcontainers/testcontainers-go/issues/2264