Home > Mobile >  No main manifest error when running spring boot microservice docker image
No main manifest error when running spring boot microservice docker image

Time:01-10

I'm trying to dockerize a microservice I've build with SpringBoot and Maven, I can build the image properly but when trying to run it inside a docker container I get the following error: enter image description here

I've read that this error has something to do with the spring-boot-maven-plugin, I've added it to my project main pom.xml file, but it still gives me the error (I've included a screenshot of the pom.xml at the end of this question).

This is my current Dockerfile:

enter image description here

Project structure:

enter image description here

Main pom.xml:

enter image description here

CodePudding user response:

I've discovered that the problem wasn't with my project, but with the "target/" folder, which is generated by maven when running "mvn install", since I haven't cleaned my "target/" folder after my first install (which didn't had the spring-boot-maven-plugin), docker was using it to build my application, hence the "no main manifest" error. After running "mvn clean" and "mvn install" for each module, docker was able to build and run both containers with no problem at all.

  • Related