Open wilkinsona opened 1 year ago
Any idea what needs to be done to fix this? Failing the PetClinic Gradle build because Docker isn't available seems really odd - I didn't think Docker was a hard requirement?
Docker Compose support is explicitly disabled when spring.aot.enabled
is true
:
We could potentially change AotDetector.useGeneratedArtifacts()
there to NativeDetector.inNativeImage()
to fix this problem, but there's some history behind that in #35548 and #35676 and I'm not sure what other side-effects making that change would have.
Thanks, Scott. #35548 and #35676 were about preventing the Docker Compose support from breaking things by getting it to back off when AOT processing or building a native image. This issue's about removing the need for that by getting it to work after AOT processing or in a native image.
The failure that I described (not very clearly) above is occurring because the Docker Compose support has backed off, leaving the tests looking for a DB on its default host and port rather than from a Compose-managed container. If we can get this to work after AOT processing or in a native image then I think we can safely stop making the support back off in those situations.
This can be reproduced using Petclinic's tests with AOT enabled:
./gradlew test
fails with both tests inPostgresIntegrationTests
failing as they could not connect to Postgres. They try to use the default host and port rather than those of a container starter by Docker Compose.