Last active
October 20, 2017 18:42
-
-
Save derekbassett/ef9791cf14285465efa0c865be1d2bbd to your computer and use it in GitHub Desktop.
Using com.spotify:dockerfile-maven-plugin with multi-project poms.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<plugin> | |
<groupId>com.spotify</groupId> | |
<artifactId>dockerfile-maven-plugin</artifactId> | |
<configuration> | |
<repository>${docker.registry}/${docker.image}</repository> | |
<tag>${docker.tag}</tag> | |
<buildArgs> | |
<JAR_FILE>${project.build.finalName}.jar</JAR_FILE> | |
</buildArgs> | |
<skip>${dockerfile.skip}</skip> | |
</configuration> | |
<executions> | |
<execution> | |
<id>default</id> | |
<goals> | |
<goal>build</goal> | |
<goal>push</goal> | |
</goals> | |
</execution> | |
</executions> | |
</plugin> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<plugin> | |
<groupId>com.spotify</groupId> | |
<artifactId>dockerfile-maven-plugin</artifactId> | |
<version>1.3.6</version> | |
<configuration> | |
<skip>true</skip> | |
</configuration> | |
</plugin> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
We have a multi-pom project which has a sub-project that wants to build a docker image.
We want to be able to call mvn dockerfile:build dockerfile:push on the parent pom and get it to build and push all docker images built in the child poms.
Here is the solution we came up with.
This allows us at the top level of the pom call mvn dockerfile:build to build all our children docker images, and at our top level mvn dockerfile.skip=true deploy will skip generating docker images in the deploy phase.