[Hotfix][CI] Fix CI failures by forcing Docker API version to 1.44#10495
[Hotfix][CI] Fix CI failures by forcing Docker API version to 1.44#10495dybyte wants to merge 5 commits intoapache:devfrom
Conversation
Issue 1: Commit History ChaosLocation: Git commit history Related Context: Problem Description:
Potential Risks:
Impact Scope:
Severity: CRITICAL Improvement Suggestions: # Developers are recommended to execute before merging:
git reset dev
# Recreate a clean commit
git add pom.xml
git commit -m "[Hotfix][CI] Force Docker API version to 1.44 for Testcontainers
Set api.version=1.44 in maven-surefire-plugin and maven-failsafe-plugin
to fix CI failures caused by Docker API version mismatch.
Ref: https://github.com/testcontainers/testcontainers-java/issues/11491"Rationale: Issue 2: Missing Upgrade Path DocumentationLocation: Related Context:
Problem Description:
Potential Risks:
Impact Scope:
Severity: MAJOR Improvement Suggestions: <!-- Temporary fix for https://github.com/testcontainers/testcontainers-java/issues/11491 -->
<!--
FIXME: Remove this when Testcontainers is upgraded to 1.18.0 or higher
Expected fix version: Testcontainers 1.18.0+
Tracking issue: https://github.com/testcontainers/testcontainers-java/issues/11491
Date added: 2026-02-14
-->
<api.version>1.44</api.version>Or create a JIRA task to track: <!--
Temporary workaround for Docker API version mismatch in GitHub Actions
See: https://github.com/testcontainers/testcontainers-java/issues/11491
Remove when: TESTCONTAINERS-XXX is resolved
-->
<api.version>1.44</api.version>Rationale: Issue 3: Missing Testcontainers Version Upgrade AssessmentLocation: Related Context:
Problem Description:
Potential Risks:
Impact Scope:
Severity: MAJOR Improvement Suggestions: ### Why not upgrade Testcontainers?
Considered upgrading from 1.17.6 to latest, but decided not to because:
- [x/y] Breaking changes in newer versions would require extensive test updates
- [x/y] Need to verify compatibility with all connectors
- [x/y] Temporary fix is lower risk for now
Plan to upgrade Testcontainers in separate PR: [issue link]Or if upgrade is feasible, should upgrade: <!-- Upgrade from 1.17.6 to 1.19.0 to fix Docker API compatibility -->
<testcontainer.version>1.19.0</testcontainer.version>Rationale: Issue 4: Local Development Environment Compatibility Not ConsideredLocation: Related Context:
Problem Description:
Potential Risks:
Impact Scope:
Severity: MINOR Improvement Suggestions: ### Docker Version Requirements
Integration tests require Docker API 1.44 or higher.
- CI/CD: Uses Docker 24.x (API 1.44)
- Local development: Requires Docker Desktop 24.x+ or Docker Engine 24.x+
If your local Docker version is older:
1. Upgrade Docker Desktop/Engine
2. Or skip Docker-based tests: `mvn verify -DskipIT=true`
3. Or override the API version: `mvn verify -Dapi.version=1.41`Or a more flexible approach (not recommended as it reduces consistency): <!-- Only enforce API version in CI environment -->
<api.version>${env.DOCKER_API_VERSION,1.44}</api.version>Rationale: Issue 5: No Docker Version Check AddedLocation: Related Context:
Problem Description:
Potential Risks:
Impact Scope:
Severity: MINOR Improvement Suggestions: - name: Check Docker version
run: |
DOCKER_VERSION=$(docker version --format '{{.Server.APIVersion}}')
echo "Docker API Version: $DOCKER_VERSION"
if [[ $(echo "$DOCKER_VERSION 1.44" | tr " " "\n" | sort -V | head -n1) != "1.44" ]]; then
echo "Error: Docker API version $DOCKER_VERSION is less than 1.44"
exit 1
fiOr print Docker version information at job start: env:
TEST_IN_PR: ${{ inputs.TEST_IN_PR }}
# Explicitly document Docker version requirement
REQUIRED_DOCKER_API_VERSION: "1.44"
steps:
- name: Print Docker info
run: |
docker version
docker infoRationale: Issue 6: Insufficient PR DescriptionLocation: GitHub PR page Related Context:
Problem Description:
Potential Risks:
Impact Scope:
Severity: MINOR Improvement Suggestions: ## Background
CI started failing consistently with error:client version 1.32 is too old. Minimum supported API version is 1.44 Rationale: |
There was a problem hiding this comment.
Pull request overview
This pull request addresses critical CI failures caused by Docker API version incompatibility with testcontainers. The CI builds have been consistently failing with an error indicating that the client version 1.32 is too old, and the minimum supported API version is 1.44.
Changes:
- Adds
api.versionsystem property set to 1.44 in maven-surefire-plugin configuration to fix unit test failures - Adds
api.versionsystem property set to 1.44 in maven-failsafe-plugin configuration to fix integration test failures
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| <!-- temporary fix for https://github.com/testcontainers/testcontainers-java/issues/11491 --> | ||
| <api.version>1.44</api.version> | ||
| </systemPropertyVariables> |
There was a problem hiding this comment.
According to the testcontainers GitHub issue #11491, the recommended approach to fix this issue is to set the DOCKER_API_VERSION environment variable rather than using a system property. Consider using <environmentVariables> instead of <systemPropertyVariables>:
<environmentVariables>
<DOCKER_API_VERSION>1.44</DOCKER_API_VERSION>
</environmentVariables>If the current approach with api.version system property doesn't work, this alternative should resolve the Docker API version compatibility issue.
| <!-- temporary fix for https://github.com/testcontainers/testcontainers-java/issues/11491 --> | |
| <api.version>1.44</api.version> | |
| </systemPropertyVariables> | |
| </systemPropertyVariables> | |
| <!-- temporary fix for https://github.com/testcontainers/testcontainers-java/issues/11491 --> | |
| <environmentVariables> | |
| <DOCKER_API_VERSION>1.44</DOCKER_API_VERSION> | |
| </environmentVariables> |
| <!-- temporary fix for https://github.com/testcontainers/testcontainers-java/issues/11491 --> | ||
| <systemPropertyVariables> | ||
| <api.version>1.44</api.version> | ||
| </systemPropertyVariables> |
There was a problem hiding this comment.
According to the testcontainers GitHub issue #11491, the recommended approach to fix this issue is to set the DOCKER_API_VERSION environment variable rather than using a system property. Consider using <environmentVariables> instead of (or in addition to) <systemPropertyVariables>:
<environmentVariables>
<DOCKER_API_VERSION>1.44</DOCKER_API_VERSION>
</environmentVariables>If the current approach with api.version system property doesn't work, this alternative should resolve the Docker API version compatibility issue.
| </systemPropertyVariables> | |
| </systemPropertyVariables> | |
| <environmentVariables> | |
| <DOCKER_API_VERSION>1.44</DOCKER_API_VERSION> | |
| </environmentVariables> |
Purpose of this pull request
The current CI process is consistently failing with the following error.
For more detailed information regarding this issue, please refer to testcontainers/testcontainers-java#11491 .
Does this PR introduce any user-facing change?
No.
How was this patch tested?
Check list
New License Guide
incompatible-changes.mdto describe the incompatibility caused by this PR.