Member-only story
Build and Push to Docker With Maven
Automatically push your project to Docker using Spotify, fabric8, and JIB Maven plugins

Your build is now fully automated with Maven. All your plugins and dependencies are in place. Your JAR is waiting for you in target
.
But how do you turn this into a Docker image and push it to your preferred Docker registry? Let’s do it together next.
Let There Be pom
We’ll create and build a simple Hello World command-line app using the Maven Quickstart Archetype:mvn archetype:generate -DarchetypeGroupId=org.apache.maven.archetypes -DarchetypeArtifactId=maven-archetype-quickstart -DarchetypeVersion=1.4 -DgroupId=com.test -DartifactId=maven-docker -Dversion=1.0.0-SNAPSHOT

Before we check if the auto-generated project compiles and runs, we need to modify the pom.xml
to build an executable JAR by modifying the plugins
section adding the following plugin
:
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<configuration>
<archive>
<manifest>
<mainClass>com.test.App</mainClass>…