docker-maven-plugin

A maven plugin to build docker images

License

License

Categories

Categories

Maven Build Tools Docker Container Virtualization Tools
GroupId

GroupId

fr.hbis.maven.plugins
ArtifactId

ArtifactId

docker-maven-plugin
Last Version

Last Version

0.2.0
Release Date

Release Date

Type

Type

maven-plugin
Description

Description

docker-maven-plugin
A maven plugin to build docker images
Project URL

Project URL

http://github.com/bhuisgen/docker-maven-plugin
Source Code Management

Source Code Management

http://github.com/bhuisgen/docker-maven-plugin/tree/master

Download docker-maven-plugin

How to add to project

<plugin>
    <groupId>fr.hbis.maven.plugins</groupId>
    <artifactId>docker-maven-plugin</artifactId>
    <version>0.2.0</version>
</plugin>

Dependencies

compile (3)

Group / Artifact Type Version
org.apache.maven : maven-core jar 3.5.0
org.apache.maven : maven-plugin-api jar 3.5.0
com.github.docker-java : docker-java jar 3.0.14

provided (1)

Group / Artifact Type Version
org.apache.maven.plugin-tools : maven-plugin-annotations jar 3.5

test (4)

Group / Artifact Type Version
org.apache.maven.plugin-testing : maven-plugin-testing-harness jar 3.3.0
org.apache.maven : maven-compat jar 3.5.0
org.mockito : mockito-all jar 2.0.2-beta
junit : junit jar 4.12

Project Modules

There are no modules declared in this project.

docker-maven-plugin

Maven plugin to build Docker images of your Java project.

Usage

To build a docker image of your project, add the plugin in your POM file:

</plugins>
    <plugin>
        <groupId>fr.hbis.maven.plugins</groupId>
        <artifactId>docker-maven-plugin</artifactId>
        <version>0.2.0</version>
        <executions>
            <execution>
                <phase>package</phase>
                <goals>
                    <goal>build</goal>
                </goals>
            </execution>
        </executions>
        <configuration>
            <directory>src/main/docker</directory>
            <imageName>registry.host.io/group/${project.artifactId}</imageName>
            <imageTags>
                <imageTag>latest</imageTag>
            </imageTags>
            <push>false</push>
            <remove>false</remove>
        </configuration>
    </plugin>
</plugins>

Create the directory src/main/docker in your project and add it your custom Dockerfile:

FROM bhuisgen/alpine-java:latest
COPY /root /

Build your project:

$ mvn clean install

Versions

Version
0.2.0