January 2018
Intermediate to advanced
414 pages
10h 29m
English
Now that we know most of the Docker concepts, we can integrate Docker with Maven using the Docker-Maven-plugin created by fabric8, so we can create Docker as part of our Maven builds. First, we will move our Dockerfile to a different folder. In the IntelliJ Project window, right-click on the src folder and choose New | Directory. We will name it Docker. Now, drag and drop the existing Dockerfile into this new directory, and we will change it to the following:
FROM openjdk:8-jdk-alpineADD maven/*.jar microservice.jarENTRYPOINT ["java","-jar", "microservice.jar"]
To manage the Dockerfile better, we just move into our project folders. When our Docker is built using the plugin, the contents of our application will ...
Read now
Unlock full access