Force Testcontainers Docker API version for Docker 29.0.0+ compatibility

Add `docker-java.properties` to spring-boot-testcontainers and
`spring-boot-test` to force an API version upgrade.

Fixes gh-48104
This commit is contained in:
Phillip Webb
2025-11-19 10:33:34 -08:00
parent b0f50581bc
commit 4625534e83
3 changed files with 12 additions and 0 deletions
@@ -43,3 +43,13 @@ include-code::MyDatasourceConfiguration[]
Having a single configuration class can be inefficient when beans from a certain domain need to be included in slice tests.
Instead, structuring the application's configuration as multiple granular classes with beans for a specific domain can enable importing them only for specific slice tests.
[[howto.testing.testcontainers-api-downgrade]]
== Downgrading Testcontainers Docker API Version
Recent versions of Docker Desktop do not support the default API version used by the Testcontainers dependency managed by Spring Boot.
To help prevent issues, Spring Boot ships with `docker-java.properties` files in the `spring-boot-testcontainers` and `spring-boot-test` jars that upgrade the API version that Testcontainers uses.
If you don't want the API version to be changed, you should add a `docker-java.properties` file in your own projects classpath.
An empty file will restore default behavior, or you can set a `api.version` property to whatever value you prefer.
@@ -0,0 +1 @@
api.version=1.44