Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save pavelfomin/b91bb78e2514e362ec86e840a686eab7 to your computer and use it in GitHub Desktop.

Select an option

Save pavelfomin/b91bb78e2514e362ec86e840a686eab7 to your computer and use it in GitHub Desktop.
Spring Boot 3.2.8 testcontainers docker api version requirement

Spring Boot 3.5.8 added a docker-java.properties file into their jar causing the testcontainers to look for the Docker API version of 1.44 or higher. If your Docker environment does not support API 1.44, try upgrading it.

If for any reason you cannot upgrade your Docker environment, affected users can add this file to their local development environment as a temporary workaround, without committing it to the repository, until they are able to upgrade their Docker environment.

One way to do this is to maintain a single version of the file and create symlinks in the affected repos

  • create the file locally
    • echo "api.version=1.41" > ~/docker-java.properties
  • in every affected repo
    • ln -s ~/docker-java.properties src/test/resources/.
  • add global git exclude
    • git config --global core.excludesfile ~/.gitignore
    • echo "src/test/resources/docker-java.properties" >> ~/.gitignore
@pavelfomin
Copy link
Author

If you updated your Docker environment and try to run testcontainers that come with Spring Boot 3.5.7, then you need to put the symlink to a file with version 1.44

echo "api.version=1.44" > ~/docker-java.properties

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment