Let's configure the Maven plugin. It is necessary to add a plugin to the plugin section on our pom.xml and add some configurations. The plugin should be configured as follows:
<plugin> <groupId>io.fabric8</groupId> <artifactId>docker-maven-plugin</artifactId> <version>0.21.0</version> <configuration> <images> <image> <name>springfivebyexample/${project.build.finalName}</name> <build> <from>openjdk:latest</from> <entryPoint>java -Dspring.profiles.active=container -jar /application/${project.build.finalName}.jar</entryPoint> <assembly> <basedir>/application</basedir> <descriptorRef>artifact</descriptorRef> <inline> <id>assembly</id> <files> <file> <source>target/${project.build.finalName}.jar</source> </file>