Skip to content

Conversation

@WieczorekAdrian
Copy link

@WieczorekAdrian WieczorekAdrian commented Dec 1, 2025

Context

In the current implementation (v2.x), UnixSocketClientProviderStrategy hardcodes the socket path to /var/run/docker.sock. It completely ignores the DOCKER_HOST environment variable.

This is a regression that prevents users (especially those using Podman or rootless Docker) from running tests if other strategies fail and the system falls back to this strategy.

Changes

  • Fix: Updated getTransportConfig in UnixSocketClientProviderStrategy.java to check for the DOCKER_HOST environment variable before defaulting to the hardcoded path.
  • Refactor: Removed the final modifier from UnixSocketClientProviderStrategy and extracted environment variable access to a protected method (getDockerHostEnv). This was necessary to make the class testable via partial mocking.
  • Test: Added a new unit test shouldRespectDockerHostEnvVar in UnixSocketClientProviderStrategyTest that verifies the fix by simulating a custom socket path.

Verification

I verified the fix locally using the added unit test, which fails without the fix and passes with it. I also ran spotlessApply to ensure code style compliance.

Fixes #11254

@WieczorekAdrian WieczorekAdrian force-pushed the fix/podman-socket-regression branch from f629f23 to ec63953 Compare December 7, 2025 22:48
@eddumelendez
Copy link
Member

I don't think this is a regression before it has never been supported as mentioned here. Before raising a PR can we please wait until we decide how to proceed? IIRC there is a reason to not support this.

@WieczorekAdrian WieczorekAdrian deleted the fix/podman-socket-regression branch December 15, 2025 23:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Can't overwrite Docker socket path with 2.0.2 / Podman stopped working

2 participants