docker-maven-plugin

November 13, 2025 ยท View on GitHub

Maven Central Circle CI Coverage Technical Debt

This is a Maven plugin for building Docker images and managing containers for integration tests. It works with Maven 3.0.5 and Docker 1.6.0 or later.

Goals

GoalDescriptionDefault Lifecycle Phase
docker:startCreate and start containerspre-integration-test
docker:stopStop and destroy containerspost-integration-test
docker:buildBuild imagesinstall
docker:watchWatch for doing rebuilds and restarts
docker:pushPush images to a registrydeploy
docker:removeRemove images from local docker hostpost-integration-test
docker:logsShow container logs
docker:sourceAttach docker build archive to Maven projectpackage
docker:saveSave image to a file
docker:tagTag imagesinstall
docker:volume-createCreate a volume to share data between containerspre-integration-test
docker:volume-removeRemove a created volumepost-integration-test
docker:copyCopy files and directories from a containerpost-integration-test

Documentation

  • The User Manual [PDF] has a detailed reference for all and everything.
  • The Introduction is a high-level overview of this plugin's features and provides a usage example. provided goals and possible configuration parameters.
  • Examples are below samples/ and contain example setups that you can use as blueprints for your projects.
  • ChangeLog has the release history of this plugin.
  • Contributing explains how you can contribute to this project. Pull requests are highly appreciated!
  • We publish nightly builds on maven central. Read How to use Docker Maven Plugin Snapshot artifacts.

Docker API Support

  • Docker 29+ (v1.44) is the minimal required version for compatibility with Docker 29+ daemon
  • Docker 1.6 (v1.18) is the minimal required version
  • Docker 1.8.1 (v1.20) is required for docker:watch
  • Docker 1.9 (v1.21) is required for using custom networks and build args.