swiched from spotify to fabric8 docker plugin
This commit is contained in:
parent
6ea6faa327
commit
856c6f4afa
@ -5,8 +5,8 @@
|
|||||||
|
|
||||||
<build>
|
<build>
|
||||||
<plugins>
|
<plugins>
|
||||||
<!-- This plugin copies the Dockerfile and resources to the base build directory -->
|
<!-- This plugin copies the Dockerfile and resources to the base context build directory -->
|
||||||
<!-- Dockerfile ADD/COPY commands can only use files inside the build directory -->
|
<!-- Dockerfile ADD/COPY commands can only use files inside the context build directory -->
|
||||||
<plugin>
|
<plugin>
|
||||||
<groupId>org.codehaus.mojo</groupId>
|
<groupId>org.codehaus.mojo</groupId>
|
||||||
<artifactId>build-helper-maven-plugin</artifactId>
|
<artifactId>build-helper-maven-plugin</artifactId>
|
||||||
@ -23,26 +23,60 @@
|
|||||||
<resource>
|
<resource>
|
||||||
<directory>${docker.source.directory}</directory>
|
<directory>${docker.source.directory}</directory>
|
||||||
<filtering>true</filtering>
|
<filtering>true</filtering>
|
||||||
<targetPath>${project.build.directory}</targetPath>
|
<targetPath>${project.build.directory}/docker/context</targetPath>
|
||||||
</resource>
|
</resource>
|
||||||
</resources>
|
</resources>
|
||||||
</configuration>
|
</configuration>
|
||||||
</execution>
|
</execution>
|
||||||
</executions>
|
</executions>
|
||||||
</plugin>
|
</plugin>
|
||||||
|
<!-- This plugin copies the Spring Boot JAR to the base build context directory -->
|
||||||
|
<!-- Dockerfile ADD/COPY commands can only use files inside the context build directory -->
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
|
<artifactId>maven-resources-plugin</artifactId>
|
||||||
|
<executions>
|
||||||
|
<execution>
|
||||||
|
<id>copy-jar</id>
|
||||||
|
<phase>package</phase>
|
||||||
|
<goals>
|
||||||
|
<goal>copy-resources</goal>
|
||||||
|
</goals>
|
||||||
|
<configuration>
|
||||||
|
<resources>
|
||||||
|
<resource>
|
||||||
|
<directory>${project.build.directory}</directory>
|
||||||
|
<includes>
|
||||||
|
<include>*.jar</include>
|
||||||
|
</includes>
|
||||||
|
</resource>
|
||||||
|
</resources>
|
||||||
|
<outputDirectory>${project.build.directory}/docker/context</outputDirectory>
|
||||||
|
</configuration>
|
||||||
|
</execution>
|
||||||
|
</executions>
|
||||||
|
</plugin>
|
||||||
<!-- This plugin configures the building and pushing of a Docker image -->
|
<!-- This plugin configures the building and pushing of a Docker image -->
|
||||||
<plugin>
|
<plugin>
|
||||||
<groupId>com.spotify</groupId>
|
<groupId>io.fabric8</groupId>
|
||||||
<artifactId>dockerfile-maven-plugin</artifactId>
|
<artifactId>docker-maven-plugin</artifactId>
|
||||||
<version>1.4.13</version>
|
<version>0.39.0</version>
|
||||||
<configuration>
|
<configuration>
|
||||||
<contextDirectory>${project.build.directory}</contextDirectory>
|
<images>
|
||||||
<repository>${docker.image.registry}/${docker.image.name}</repository>
|
<image>
|
||||||
<tag>${docker.image.tag}</tag>
|
<name>${docker.image.name}</name>
|
||||||
<useMavenSettingsForAuth>true</useMavenSettingsForAuth>
|
<alias>${artifactId}-docker-image</alias>
|
||||||
<buildArgs>
|
<build>
|
||||||
<JAR_FILE>${project.artifactId}-${project.version}.jar</JAR_FILE>
|
<contextDir>${project.build.directory}/docker/context</contextDir>
|
||||||
</buildArgs>
|
<args>
|
||||||
|
<JAR_FILE>${project.artifactId}-${project.version}.jar</JAR_FILE>
|
||||||
|
</args>
|
||||||
|
<tags>
|
||||||
|
<tag>${docker.image.tag}</tag>
|
||||||
|
</tags>
|
||||||
|
</build>
|
||||||
|
</image>
|
||||||
|
</images>
|
||||||
</configuration>
|
</configuration>
|
||||||
<executions>
|
<executions>
|
||||||
<execution>
|
<execution>
|
||||||
@ -50,18 +84,29 @@
|
|||||||
<phase>package</phase>
|
<phase>package</phase>
|
||||||
<goals><goal>build</goal></goals>
|
<goals><goal>build</goal></goals>
|
||||||
<configuration>
|
<configuration>
|
||||||
<repository>${docker.image.name}</repository>
|
<skipPush>true</skipPush>
|
||||||
|
<skipTag>false</skipTag> <!-- BUG workaround -->
|
||||||
</configuration>
|
</configuration>
|
||||||
</execution>
|
</execution>
|
||||||
|
<!-- BUG: artifactId appears to be automatically appended to docker.image.name
|
||||||
|
add tag to build for now -->
|
||||||
|
<!--
|
||||||
<execution>
|
<execution>
|
||||||
<id>docker-tag-registry</id>
|
<id>docker-tag</id>
|
||||||
<phase>install</phase>
|
<phase>install</phase>
|
||||||
<goals><goal>tag</goal></goals>
|
<goals><goal>tag</goal></goals>
|
||||||
|
<configuration>
|
||||||
|
<tagName>${docker.image.tag}</tagName>
|
||||||
|
</configuration>
|
||||||
</execution>
|
</execution>
|
||||||
|
-->
|
||||||
<execution>
|
<execution>
|
||||||
<id>docker-push</id>
|
<id>docker-push</id>
|
||||||
<phase>deploy</phase>
|
<phase>deploy</phase>
|
||||||
<goals><goal>push</goal></goals>
|
<goals><goal>push</goal></goals>
|
||||||
|
<configuration>
|
||||||
|
<pushRegistry>${docker.image.registry}</pushRegistry>
|
||||||
|
</configuration>
|
||||||
</execution>
|
</execution>
|
||||||
</executions>
|
</executions>
|
||||||
</plugin>
|
</plugin>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user