Skip to content

Commit ac1c0db

Browse files
sundancekid73claude
andcommitted
fix: upgrade Testcontainers to 1.20.1 and fix Docker Desktop compatibility on Windows
- Upgrade testContainersVersion from 1.17.6 to 1.20.1 - Override DOCKER_HOST to docker_engine_linux pipe to bypass Docker Desktop relay - Add docker-java.properties with api.version=1.41 to satisfy Docker daemon minimum API requirement (1.40+) - Replace deprecated getContainerIpAddress() with getHost() in MongoDbContainer Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent a62aa79 commit ac1c0db

3 files changed

Lines changed: 4 additions & 2 deletions

File tree

build.gradle

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ ext {
1717
lombokVersion = '1.18.22'
1818
springBootVersion = '2.4.5'
1919
springSecurityVersion = '5.4.6'
20-
testContainersVersion = '1.15.3'
20+
testContainersVersion = '1.20.1'
2121
swaggerVersion = '2.9.2'
2222
}
2323

@@ -63,6 +63,7 @@ sourceSets {
6363
test {
6464
useJUnitPlatform()
6565
finalizedBy jacocoTestReport
66+
environment 'DOCKER_HOST', 'npipe:////./pipe/docker_engine_linux'
6667
}
6768

6869
jacoco {

src/test/java/net/gendercomics/api/integrationtest/MongoDbContainer.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ public MongoDbContainer(DockerImageName dockerImageName) {
1313
}
1414

1515
public String getUri() {
16-
final String ip = this.getContainerIpAddress();
16+
final String ip = this.getHost();
1717
final Integer port = this.getMappedPort(PORT);
1818
return String.format("mongodb://%s:%s/test", ip, port);
1919
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
api.version=1.41

0 commit comments

Comments
 (0)