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:
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:
Project structure:
Main pom.xml:
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.