Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gradle build fails when Docker is not available #1307

Closed
irinatudose opened this issue Jul 27, 2023 · 6 comments · Fixed by #1411
Closed

gradle build fails when Docker is not available #1307

irinatudose opened this issue Jul 27, 2023 · 6 comments · Fixed by #1411

Comments

@irinatudose
Copy link

When Docker is not available ./gradlew clean build fails because of the processTestAot failed task.

 ./gradlew clean build
...
> Task :processTestAot FAILED
...
Exception in thread "main" org.testcontainers.containers.ContainerFetchException: Can't get Docker image: RemoteDockerImage(imageName=mysql:5.7, imagePullPolicy=DefaultPullPolicy(), imageNameSubstitutor=org.testcontainers.utility.ImageNameSubstitutor$LogWrappedImageNameSubstitutor@62163b39)
...
Caused by: java.lang.IllegalStateException: Could not find a valid Docker environment. Please see logs and check configuration

My current workaround is to skip the processTestAot task, and build with ./gradlew clean build -x processTestAot which works.

The maven build, however, doesn't have this issue. It works with or without Docker.

Any idea of what the problem is?

@dsyer
Copy link
Member

dsyer commented Aug 24, 2023

Maven doesn't run the AOT processor by default, so that explains why it doesn't fail if you do the simplest possible thing. I'll ask the AOT team if there's anything we can do to fix the Gradle build, other than your workaround.

See spring-projects/spring-boot#37097 for more detail and tracking progress. Also spring-projects/spring-boot#36273.

@roxspring
Copy link
Contributor

Does Gradle need to run the AOT processor by default? Would it be reasonable to fix this by making AOT opt-in rather than broken by default, matching Maven?

@dsyer
Copy link
Member

dsyer commented Nov 28, 2023

You’re asking in the wrong place. Petclinic is just a user of the build tools. Follow links to issues in my last comment.

@wilkinsona
Copy link
Member

Adding the new @DisabledInAotMode annotation to the tests where Docker Compose support is enabled would fix this I believe.

@dsyer
Copy link
Member

dsyer commented Dec 5, 2023

It works for me now, so I think someone already did that.

@roxspring
Copy link
Contributor

Hmmm. Still seems broken to me...

But applying @wilkinsona's recommendation seems to work in #1411.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants
@dsyer @roxspring @wilkinsona @irinatudose and others