Maven plugin to build Docker images
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
.idea
src
.gitignore
CHANGELOG.md
LICENSE
README.md
docker-maven-plugin.iml
pom.xml

README.md

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