Fix Docker API version incompatibility by removing forced default version #11336
+0
−4
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Motivation
Fixes #11232
In #11216, a default fallback to VERSION_1_44 was introduced in DockerClientProviderStrategy. However, this change broke compatibility for users running older Docker versions (e.g., Docker v24 supports up to API 1.43) because the client forces a newer API version than the server supports.
Since docker-java supports auto-negotiation when the version is null (UNKNOWN), strictly pinning it to 1.44 is unnecessary and causes regressions for legacy environments.
Changes
Removed the block that forces VERSION_1_44 when the API version is unknown.
This restores the behavior of relying on docker-java's auto-negotiation (or safe defaults).
Verification
I have verified this fix locally on the following environments:
Docker v29.1.2 (API 1.52, Min 1.44): Passed. (Auto-negotiated correctly)
Docker v24.0 (dind, API 1.43): Passed. (Auto-negotiated correctly)