I’ve been stuck on a problem for hours: I have a Spring Boot application that I run in a docker container. For this I use layered jars. This all worked fine. Then I had to change the application so that two databases (PostgreSQL) are configured. If I just run the jar file via java -jar, everything works fine. But as soon as I run the application in the container, it hangs without any error message or similar. Since the last log what I see on the console is :
2020-12-09 13:09:58.282 DEBUG 1 --- [ main] o.h.boot.internal.BootstrapContextImpl : Injecting ScanOptions [[email protected]fedf1] into BootstrapContext; was [[email protected]a90ce]
After that nothing more happens. My docker file looks like this:
FROM amazoncorretto:11 as builder COPY app.jar app.jar RUN java -Djarmode=layertools -jar app.jar extract FROM amazoncorretto:11 COPY --from=builder dependencies/ ./ COPY --from=builder snapshot-dependencies/ ./ RUN true COPY --from=builder spring-boot-loader/ ./ COPY --from=builder application/ ./ ENTRYPOINT ["java","org.springframework.boot.loader.JarLauncher"]
Does anyone know what the problem is or where I can further search for the cause?
Source: Docker Questions