According to the documentation (https://docs.spring.io/spring-boot/docs/current/reference/html/features.html#features.docker-compose), Spring boot execute docker compose up when application starts and docker compose stop when application is shutdown. It works very well when the main method is called.

But it does not work with tests (@SpringBootTest). This forces to execute the docker command manually on a terminal window. If it is intentional the documentation could explain why.

Comment From: wilkinsona

You can set spring.docker.compose.skip.in-tests=false to enable the Docker Compose support in your tests. We'll improve the documentation in this area. Thanks for the suggestion.

Comment From: araragao

You can set spring.docker.compose.skip.in-tests=true to enable the Docker Compose support in your tests. We'll improve the documentation in this area. Thanks for the suggestion.

I believe you mean exactly the opposite: spring.docker.compose.skip.in-tests=false.

Comment From: wilkinsona

Oops. Thanks, @araragao. I did indeed. I've edited my comment above to avoid any further confusion.

Comment From: wilkinsona

Closing in favor of #36636.