Skip to content

etux/docker-maven-plugin

develop
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 

docker-maven-plugin

Maven plugin to interact with Docker.

The idea of this plugin is to be able to operate Docker from Maven. All elements of the ContainerConfig are supported.

Initial implementation should covers:

  • pull image
  • start container
  • stop container
  • restart container
  • create container
  • remove container
  • kill container

In order to use, add

<plugins>
    <plugin>
        <groupId>org.etux.maven.plugins</groupId>
        <artifactId>docker-maven-plugin</artifactId>
        <version>0.0.1</version>
        <configuration>
            <url>http://192.168.1.111:4342</url>
            <containerImage>ubuntu</containerImage>
        </configuration>
    </plugin>
</plugins>

to your POM.

Then you can execute any goals:

  • mvn docker:pullImage -DcontainerImage=<containerImage>
  • mvn docker:createContainer -DcontainerImage=<containerImage>
  • mvn docker:startContainer -DcontainerId=<containerId>
  • mvn docker:stopContainer -DcontainerId=<containerId>
  • mvn docker:restartContainer -DcontainerId=<containerId>
  • mvn docker:removeContainer -DcontainerId=<containerId>
  • mvn docker:killContainer -DcontainerId=<containerId>

In case two different goals are executed as part of the same Maven session, then these two will share the containerId as long as they execute on the same thread.

About

Maven plugin to interact with Docker.

Resources

License

Stars

Watchers

Forks

Packages

No packages published