Search code examples
dockerkotlinmicronaut

Docker - Micronaut project throws: No embbeded container found


I have a Kotlin-project where I work with Micronaut. I now wanted to dockerize the project. After importing and trying to start the conatiner I always get No embbeded container found. Running as CLI application. I've already searched for a solution but the only thing I found was to have 'implementation("io.micronaut:micronaut-http-server-netty")' in the project which I already have. What else could be the root of the problem?

My Dockerfile looks like this:

FROM adoptopenjdk/openjdk13-openj9:jdk-13.0.2_8_openj9-0.18.0-alpine-slim
COPY build/libs/prj-*-dev.jar prj.jar
EXPOSE 8080
CMD ["java", "-Dcom.sun.management.jmxremote", "-Xmx128m", "-XX:+IdleTuningGcOnIdle", "-Xtune:virtualized", "-jar", "prj.jar"]


Solution

  • So I found the problem: In the Gradle-build-file the ShadowJar-operation was commented out. It is needed to run this operation before creating the dockerfile. So I decommented it again and now it works!