Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
137 lines (125 sloc) 5.99 KB
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.example.docker</groupId>
<artifactId>docker-base-image</artifactId>
<version>1.0.0-SNAPSHOT</version>
<description>Docker Base Image Example using ONBUILD</description>
<properties>
<docker.registry>hub.docker.com</docker.registry>
<docker.namespace>changeme</docker.namespace>
<docker.name>${project.artifactId}</docker.name>
<docker.repository>${docker.registry}/${docker.namespace}/${docker.name}</docker.repository>
<!-- the suffix is used to append an arbitrary string to the version, e.g. a build number or SCM tag -->
<docker.version.suffix />
<docker.tag>${project.version}${docker.version.suffix}</docker.tag>
<docker.image>${docker.name}:${docker.tag}</docker.image>
<dockerfile-maven-plugin.version>1.4.4</dockerfile-maven-plugin.version>
<dockerfile.build.pullNewerImage>true</dockerfile.build.pullNewerImage>
<exec.mainClass>com.example.docker.ChangeMe</exec.mainClass>
<logback.version>1.2.3</logback.version>
<logstash-logback-encoder.version>5.3</logstash-logback-encoder.version>
<maven-jar-plugin.version>3.1.0</maven-jar-plugin.version>
</properties>
<profiles>
<profile>
<id>docker</id>
<activation>
<file>
<exists>Dockerfile</exists>
</file>
</activation>
<dependencies>
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
<version>${logback.version}</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>com.spotify</groupId>
<artifactId>dockerfile-maven-plugin</artifactId>
<version>${dockerfile-maven-plugin.version}</version>
<executions>
<execution>
<id>default</id>
<goals>
<goal>build</goal>
<goal>push</goal>
</goals>
</execution>
</executions>
<configuration>
<repository>${docker.repository}</repository>
<useMavenSettingsForAuth>true</useMavenSettingsForAuth>
<tag>${docker.tag}</tag>
<buildArgs>
<JAR_FILE>microservice.jar</JAR_FILE>
<GROUP_ID>${project.groupId}</GROUP_ID>
<ARTIFACT_ID>${project.artifactId}</ARTIFACT_ID>
<VERSION>${project.version}</VERSION>
<HTTP_PROXY>${env.HTTP_PROXY}</HTTP_PROXY>
<HTTPS_PROXY>${env.HTTPS_PROXY}</HTTPS_PROXY>
<NO_PROXY>${env.NO_PROXY}</NO_PROXY>
</buildArgs>
</configuration>
</plugin>
<plugin>
<artifactId>maven-dependency-plugin</artifactId>
<executions>
<execution>
<phase>initialize</phase>
<goals>
<goal>copy-dependencies</goal>
</goals>
<configuration>
<overWriteReleases>false</overWriteReleases>
<includeScope>runtime</includeScope>
<outputDirectory>${project.build.directory}/lib</outputDirectory>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>${maven-jar-plugin.version}</version>
<configuration>
<archive>
<manifest>
<addClasspath>true</addClasspath>
<mainClass>${exec.mainClass}</mainClass>
<classpathPrefix>lib/</classpathPrefix>
<useUniqueVersions>false</useUniqueVersions>
</manifest>
</archive>
</configuration>
</plugin>
</plugins>
</build>
</profile>
</profiles>
<build>
<extensions>
<!-- enables dependency management between Maven docker projects -->
<extension>
<groupId>com.spotify</groupId>
<artifactId>dockerfile-maven-extension</artifactId>
<version>${dockerfile-maven-plugin.version}</version>
</extension>
</extensions>
</build>
<dependencies>
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
<version>${logback.version}</version>
</dependency>
<dependency>
<groupId>net.logstash.logback</groupId>
<artifactId>logstash-logback-encoder</artifactId>
<version>${logstash-logback-encoder.version}</version>
</dependency>
</dependencies>
</project>
You can’t perform that action at this time.