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

Chapter 7: Fails to build docker image with Tilt #61

Closed
elR1cu opened this issue Jan 25, 2024 · 2 comments
Closed

Chapter 7: Fails to build docker image with Tilt #61

elR1cu opened this issue Jan 25, 2024 · 2 comments

Comments

@elR1cu
Copy link

elR1cu commented Jan 25, 2024

Hi,
I can successfully build the catalog-service image locally when I run the maven command. All is fine, and testcontainers ITs are ok.
However, when I try to build the image with Tilt, I get a problem with testcontainers when running integration tests :

2024-01-25T09:27:58.911+01:00  WARN 2867 --- [catalog-service] [containers-ryuk] o.t.utility.RyukResourceReaper           : Can not connect to Ryuk at 127.0.0.1:32768

java.net.ConnectException: Connection refused
	at java.base/sun.nio.ch.Net.pollConnect(Native Method) ~[na:na]
	at java.base/sun.nio.ch.Net.pollConnectNow(Net.java:682) ~[na:na]
	at java.base/sun.nio.ch.NioSocketImpl.timedFinishConnect(NioSocketImpl.java:549) ~[na:na]
	at java.base/sun.nio.ch.NioSocketImpl.connect(NioSocketImpl.java:592) ~[na:na]
	at java.base/java.net.SocksSocketImpl.connect(SocksSocketImpl.java:327) ~[na:na]
	at java.base/java.net.Socket.connect(Socket.java:751) ~[na:na]
	at org.testcontainers.utility.RyukResourceReaper.lambda$null$1(RyukResourceReaper.java:105) ~[testcontainers-1.19.3.jar:1.19.3]
	at org.rnorth.ducttape.ratelimits.RateLimiter.doWhenReady(RateLimiter.java:27) ~[duct-tape-1.0.8.jar:na]
	at org.testcontainers.utility.RyukResourceReaper.lambda$maybeStart$2(RyukResourceReaper.java:101) ~[testcontainers-1.19.3.jar:1.19.3]
	at java.base/java.lang.Thread.run(Thread.java:1583) ~[na:na]

Any idea ?
Thanks a lot !

@elR1cu
Copy link
Author

elR1cu commented Jan 26, 2024

I've tried with the gradle command, and it seems the tests are not run. According to this, the equivalent maven command to gradle bootBuildImage is mvn spring-boot:build-image but the latter run all the preceding phases to package phase, so also the test phase. According to Spring Boot Maven documentation, the equivalent command would be instead mvn spring-boot:build-image-no-fork. In this case, no tests are run and just the image is built. Or instead mvnw spring-boot:build-image -DskipTests.

@ThomasVitale does it make sense for you to update the Gradle and Maven section ?

@ThomasVitale
Copy link
Owner

@elR1cu thanks a lot for reporting this inconsistency between Gradle and Maven. I have updated the table in the README.md file accordingly: 3b19d02

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

No branches or pull requests

2 participants