{"id":29840417,"url":"https://github.com/wouterd/docker-maven-plugin","last_synced_at":"2025-07-29T14:12:34.703Z","repository":{"id":15998825,"uuid":"18742110","full_name":"wouterd/docker-maven-plugin","owner":"wouterd","description":"A maven plugin to manage docker containers and images for integration tests.","archived":false,"fork":false,"pushed_at":"2017-03-07T07:58:59.000Z","size":531,"stargazers_count":79,"open_issues_count":14,"forks_count":24,"subscribers_count":11,"default_branch":"master","last_synced_at":"2025-07-27T21:24:52.620Z","etag":null,"topics":["docker-container","docker-daemon","docker-image","java"],"latest_commit_sha":null,"homepage":null,"language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/wouterd.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-04-13T22:56:35.000Z","updated_at":"2025-07-08T01:35:47.000Z","dependencies_parsed_at":"2022-08-30T14:01:53.996Z","dependency_job_id":null,"html_url":"https://github.com/wouterd/docker-maven-plugin","commit_stats":null,"previous_names":[],"tags_count":22,"template":false,"template_full_name":null,"purl":"pkg:github/wouterd/docker-maven-plugin","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wouterd%2Fdocker-maven-plugin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wouterd%2Fdocker-maven-plugin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wouterd%2Fdocker-maven-plugin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wouterd%2Fdocker-maven-plugin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/wouterd","download_url":"https://codeload.github.com/wouterd/docker-maven-plugin/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wouterd%2Fdocker-maven-plugin/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267701337,"owners_count":24130451,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-07-29T02:00:12.549Z","response_time":2574,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["docker-container","docker-daemon","docker-image","java"],"created_at":"2025-07-29T14:12:29.574Z","updated_at":"2025-07-29T14:12:34.689Z","avatar_url":"https://github.com/wouterd.png","language":"Java","readme":"docker-maven-plugin\n===================\n\n[![No Maintenance Intended](http://unmaintained.tech/badge.svg)](http://unmaintained.tech/)\n\n[![Join the chat at https://gitter.im/wouterd/docker-maven-plugin](https://badges.gitter.im/wouterd/docker-maven-plugin.svg)](https://gitter.im/wouterd/docker-maven-plugin?utm_source=badge\u0026utm_medium=badge\u0026utm_campaign=pr-badge\u0026utm_content=badge)\n\n[![Build Status](https://travis-ci.org/wouterd/docker-maven-plugin.svg?branch=master)](https://travis-ci.org/wouterd/docker-maven-plugin)\n\nA maven plugin to create, test and publish docker containers and images for maven projects. Can also be used to integration test your application using docker containers.\n\n# About this document\nAs the documentation evolves with different plugin versions, be sure that before you read on that:\n- You check that you are watching the right tag\n- Switch to the right tag to read the right documentation.\n\nThe README of the master branch will cover the current development version and not cover the current released version.\n\n# Minimum versions required for the plugin to work\n\n- Minimum required java version: 8\n- Minimum required maven version: 3.1.1\n- Minimum required docker daemon version: 1.9 (Remote API v1.21)\n\n# Current Functionality:\n- Build a docker image from a bunch of source files in package and pre-integration-test phases\n      - Allow built containers to be started in the pre-integration phase\n- Start a container in the pre-integration-test phase based on an image:\n      - Known on the docker host by a name\n      - Available in a repository\n- Wait for a container to initialize by checking for a phrase in the stderr/stdout of the container\n- Link containers (same as docker run --link)\n- Commit the state of a running container to a new image\n- Shut down containers in the post-integration-test phase that were started in the pre-integration-test phase\n- Supply information to the project during the integration-test phase about:\n      - Images that were built\n      - Containers that were started\n- Verifies the build in the \"verify\" phase which tests if anything upto the integration test phase failed.\n- Assign release tags to a docker image in the install phase\n- Push docker images to a public or private image registry in the deploy phase\n- Docker provider for \"local docker\" via tcp\n- Docker provider for \"remote docker\" via tcp (boot2docker/vm/server/localhost via tcp)\n\n# Usage\n\nCurrent release version: `5.0.0`\n\nCurrent snapshot version: `5.0.1-SNAPSHOT`\n\n## Example\nThe following is a snippet from the pom for one of the integration test projects in this project. You can find the full\npom.xml here: [pom.xml](https://github.com/wouterd/docker-maven-plugin/blob/master/src/it/sample-api-mongo-it/pom.xml)\n\n    \u003cplugin\u003e\n      \u003cgroupId\u003enet.wouterdanes.docker\u003c/groupId\u003e\n      \u003cartifactId\u003edocker-maven-plugin\u003c/artifactId\u003e\n      \u003cversion\u003e5.0.0\u003c/version\u003e\n      \u003cexecutions\u003e\n        \u003cexecution\u003e\n          \u003cid\u003epackage\u003c/id\u003e\n          \u003cgoals\u003e\n            \u003cgoal\u003ebuild-images\u003c/goal\u003e\n          \u003c/goals\u003e\n          \u003cconfiguration\u003e\n            \u003cimages\u003e\n              \u003cimage\u003e\n                \u003cid\u003eapp\u003c/id\u003e\n                \u003cdockerFile\u003e${project.basedir}/src/main/docker/Dockerfile\u003c/dockerFile\u003e\n                \u003cartifacts\u003e\n                  \u003cartifact\u003e\n                    \u003cfile\u003e${project.build.directory}/discuss-jar-with-dependencies.jar\u003c/file\u003e\n                  \u003c/artifact\u003e\n                \u003c/artifacts\u003e\n              \u003c/image\u003e\n            \u003c/images\u003e\n          \u003c/configuration\u003e\n        \u003c/execution\u003e\n        \u003cexecution\u003e\n          \u003cid\u003estart\u003c/id\u003e\n          \u003cgoals\u003e\n            \u003cgoal\u003estart-containers\u003c/goal\u003e\n          \u003c/goals\u003e\n          \u003cconfiguration\u003e\n            \u003c!-- You can set forceCleanup to true to stop and remove started containers\n                 at the end of the build even if the stop-containers goal is not executed\n                 (useful for preventing Ctrl+C causing dangling containers) --\u003e\n            \u003cforceCleanup\u003efalse\u003c/forceCleanup\u003e\n            \u003ccontainers\u003e\n              \u003ccontainer\u003e\n                \u003cid\u003emongo\u003c/id\u003e\n                \u003cimage\u003emongo:2.6\u003c/image\u003e\n                \u003cwaitForStartup\u003ewaiting for connections on port 27017\u003c/waitForStartup\u003e\n              \u003c/container\u003e\n              \u003ccontainer\u003e\n                \u003cid\u003eapp\u003c/id\u003e\n                \u003cimage\u003eapp\u003c/image\u003e\n                \u003clinks\u003e\n                  \u003clink\u003e\n                    \u003ccontainerId\u003emongo\u003c/containerId\u003e\n                    \u003ccontainerAlias\u003emongo\u003c/containerAlias\u003e\n                  \u003c/link\u003e\n                \u003c/links\u003e\n                \u003cenv\u003e\n                  \u003cAPP_MESSAGE\u003eHello, world!\u003c/APP_MESSAGE\u003e\n                \u003c/env\u003e\n                \u003cwaitForStartup\u003eRatpack started for\u003c/waitForStartup\u003e\n              \u003c/container\u003e\n              \u003ccontainer\u003e\n                \u003cid\u003eapp2\u003c/id\u003e\n                \u003cimage\u003eapp\u003c/image\u003e\n                \u003clinks\u003e\n                  \u003clink\u003e\n                    \u003ccontainerId\u003emongo\u003c/containerId\u003e\n                    \u003ccontainerAlias\u003emongo\u003c/containerAlias\u003e\n                  \u003c/link\u003e\n                \u003c/links\u003e\n                \u003cenv\u003e\n                  \u003cAPP_MESSAGE\u003eI am, so I message\u003c/APP_MESSAGE\u003e\n                \u003c/env\u003e\n                \u003cwaitForStartup\u003eRatpack started for\u003c/waitForStartup\u003e\n              \u003c/container\u003e\n            \u003c/containers\u003e\n          \u003c/configuration\u003e\n        \u003c/execution\u003e\n        \u003cexecution\u003e\n          \u003cid\u003ecommit\u003c/id\u003e\n          \u003cconfiguration\u003e\n            \u003ccontainers\u003e\n              \u003ccontainer\u003e\n                \u003cid\u003eapp2\u003c/id\u003e\n                \u003crepo\u003eme/app\u003c/repo\u003e\n                \u003ctag\u003e1.0\u003c/tag\u003e\n                \u003cpush\u003etrue\u003c/push\u003e\n              \u003c/container\u003e\n            \u003c/containers\u003e\n          \u003c/configuration\u003e\n          \u003cgoals\u003e\n            \u003cgoal\u003ecommit-container\u003c/goal\u003e\n          \u003c/goals\u003e\n        \u003c/execution\u003e\n        \u003cexecution\u003e\n          \u003cid\u003estop\u003c/id\u003e\n          \u003cgoals\u003e\n            \u003cgoal\u003estop-containers\u003c/goal\u003e\n          \u003c/goals\u003e\n        \u003c/execution\u003e\n        \u003cexecution\u003e\n          \u003cid\u003everify\u003c/id\u003e\n          \u003cgoals\u003e\n            \u003cgoal\u003everify\u003c/goal\u003e\n          \u003c/goals\u003e\n        \u003c/execution\u003e\n      \u003c/executions\u003e\n    \u003c/plugin\u003e\n\nThe above pom.xml element includes the plugin and starts builds an image from the project. Then it starts some containers\nin the pre-integration-test phase, including the built container and stops those in the post-integration-test phase.\nUnder `\u003cconfiguration\u003e` add some containers. By giving them an `id`, you can reference them later and the ID is also\nused in the port mapping properties. The `\u003cimage\u003e` tag specifies the docker image to start.\n\nBy default, all exposed ports are published on the host. The following two properties are set per exposed port:\n- docker.containers.[id].ports.[portname].host (f.ex 'docker.containers.id.app.ports.80/tcp.host')\n- docker.containers.[id].ports.[portname].port (f.ex 'docker.containers.id.app.ports.80/tcp.port')\n\nYou can pass those project properties over to your integration test and use them to connect to your application.\n\nThe plugin will connect to a docker instance over HTTP, linux socket support will be added after 1.0. It will look up\nthe host/port of docker in the following way:\n- It will grab host and port from docker.host and docker.port set by -Ddocker.host and -Ddocker.port on the command line\n- Else it will try to parse the DOCKER_HOST system environment variable\n- Finally it will default to 127.0.0.1:2375\n\n## Environment Variables\n\nEnvironment variables can be passed to containers using the following configuration syntax:\n\n            \u003ccontainer\u003e\n                \u003cid\u003eapp\u003c/id\u003e\n                \u003cimage\u003eapp\u003c/image\u003e\n                \u003cenv\u003e\n                    \u003cVARIABLE_NAME\u003evariable value\u003cVARIABLE_NAME\u003e\n                \u003cenv\u003e\n            \u003c/container\u003e\n\n## Setting the hostname\n\nThe hostname can be set by adding a \u003chostname\u003e element to a container configuration.\n\n            \u003ccontainer\u003e\n                \u003cid\u003eapp\u003c/id\u003e\n                \u003cimage\u003eapp\u003c/image\u003e\n                \u003chostname\u003eappserver1\u003c/hostname\u003e\n            \u003c/container\u003e\n\n## Setting the hostname\n\nThe macAddress can be set by adding a \u003cmacAddress\u003e element to a container configuration.\n\n            \u003ccontainer\u003e\n                \u003cid\u003eapp\u003c/id\u003e\n                \u003cimage\u003eapp\u003c/image\u003e\n                \u003cmacAddress\u003e12:34:56:78:9a:bc\u003c/macAddress\u003e\n            \u003c/container\u003e\n\n## Linking containers\n\nContainers can be linked, similar to the `--link name:alias` parameter of the `docker run` command.\nThe configuration snippet looks as follows:\n\n            \u003ccontainer\u003e\n                \u003cid\u003eapp\u003c/id\u003e\n                \u003cimage\u003eapp\u003c/image\u003e\n                \u003clinks\u003e\n                    \u003clink\u003e\n                        \u003ccontainerId\u003emongo\u003c/containerId\u003e\n                        \u003ccontainerAlias\u003emongo\u003c/containerAlias\u003e\n                    \u003c/link\u003e\n                \u003c/links\u003e\n            \u003c/container\u003e\n\nThe containerId is the id specified in another `\u003ccontainer\u003e` definition. It will be replaced with the container name of\n the started container when the plugin is executed. The containerAlias is the name of the container being linked inside\n the container that links the container. It's also the hostname of the linked container for the linking container. In\n the case of the above XML snippet, I can now reach the mongodb instance using `mongo:27017` as the connection string.\n\n## Wait for a container to finish starting up\n\nYou might want to wait for your application to finish initialization before you start running integration tests. The\nplugin allows you to do a global regular expression find on the stdout + stderr of your container to see if the\ncontainer has finished initialization. To check if a tomcat container has started up, you could configure the following:\n\n        \u003ccontainer\u003e\n            \u003cid\u003eapp-server\u003c/id\u003e\n            \u003cimage\u003emyAppServer\u003c/image\u003e\n            \u003cwaitForStartup\u003eServer startup in\u003c/waitForStartup\u003e\n        \u003c/container\u003e\n\nThe `\u003cwaitForStartup/\u003e` tag can contain any valid java regular expression.\n\n## `build-images` goal\nThe `build-images` goal allows you to build a docker image based on a list of files, one of which must be a `Dockerfile`.\nBelow is an example snippet.\n\n          \u003cexecution\u003e\n            \u003cid\u003ebuild\u003c/id\u003e\n            \u003cgoals\u003e\n              \u003cgoal\u003ebuild-images\u003c/goal\u003e\n            \u003c/goals\u003e\n            \u003cconfiguration\u003e\n              \u003cimages\u003e\n                \u003cimage\u003e\n                  \u003cid\u003enginx\u003c/id\u003e\n                  \u003cdockerFile\u003e${project.basedir}/src/test/resources/Dockerfile\u003c/dockerFile\u003e\n                  \u003cartifacts\u003e\n                    \u003cartifact\u003e\n                      \u003cfile\u003e${project.basedir}/src/test/resources/nginx.conf\u003c/file\u003e\n                      \u003cdest\u003eetc/nginx/nginx.conf\u003c/dest\u003e\n                    \u003c/artifact\u003e\n                    \u003cartifact\u003e\n                      \u003cfile\u003e${project.basedir}/src/test/resources/sites-available/\u003c/file\u003e\n                      \u003cdest\u003eetc/nginx/sites-available/\u003c/dest\u003e\n                    \u003c/artifact\u003e\n                  \u003c/artifacts\u003e\n                  \u003cmavenArtifacts\u003e\n                    \u003cmavenArtifact\u003e\n                      \u003cdependency\u003ebiz.hochguertel.javaeetutorial.jaxrs:hello:war:1.4\u003c/dependency\u003e\n                      \u003cdest\u003etest/rest.war\u003c/dest\u003e\n                    \u003c/mavenArtifact\u003e\n                  \u003c/mavenArtifacts\u003e\n                  \u003cbuildArguments\u003e\n                    \u003cfoo\u003ebar\u003c/foo\u003e\n                  \u003c/buildArguments\u003e\n                  \u003ckeep\u003etrue\u003c/keep\u003e\n                  \u003cpush\u003etrue\u003c/push\u003e\n                  \u003cregistry\u003emydocker-registry.corp.com:5000\u003c/registry\u003e\n                  \u003cnameAndTag\u003ewouterd/my-nginx:1.0\u003c/nameAndTag\u003e\n                \u003c/image\u003e\n              \u003c/images\u003e\n            \u003c/configuration\u003e\n          \u003c/execution\u003e\n\nThe configuration works as follows:\n- `\u003cimages\u003e` contains a list of images to build as `\u003cimage\u003e` elements\n- `\u003cid\u003e` for an image specifies the ID you want to use to reference this image in the plugin, for example when starting\n    a container based on a built image.\n  `\u003cdockerFile\u003e` specifies which file to use a the Dockerfile\n- `\u003cartifacts\u003e` contains a list of files to add to the container as `\u003cartifact\u003e` elements. For each `\u003cartifact\u003e` element\n    you can specify:\n    - `file`: pointing to the file to add to the tar ball sent to the docker daemon\n    - `dest`: path in the tar ball where you want the file, you can refer to it using the same path in an ADD statement.\n- `\u003cbuildArguments\u003e` contains a list of build arguments that can be used in your Dockerfile\n    you can specify:\n    - `tag_name`: The name of the tag will be used as the name of the build argument e.g. `\u003cfoo\u003e` will create a build argument called `foo` that can be used in your dockerfile as `$foo`.\n    - `tag_value`: The value of the tag will be used as the value of the build argument e.g. `\u003cfoo\u003ebar\u003c/foo\u003e` will create a build argument called `foo` with the value `bar` that can be used in your dockerfile as `$foo`.\n- `\u003cmavenArtifacts\u003e` contains a list of Maven dependencies to add to the container as `\u003cmavenArtifact\u003e` elements. For each `\u003cmavenArtifact\u003e` element\n    you can specify:\n    - `dependency`: A maven dependency in the format \\\u003cgroupId\\\u003e:\\\u003cartifactId\\\u003e[:\\\u003cextension\\\u003e[:\\\u003cclassifier\\\u003e]]:\\\u003cversion\\\u003e\n    - `dest`: path in the tar ball where you want the maven dependency put, you can refer to it using the same path in an ADD statement.    \n- `\u003ckeep\u003e` (defaults to false) specifies whether or not the plugin should keep this image or delete it after executing\n    the maven build. If false, the image will be deleted as part of the `stop-containers` goal.\n- `\u003cnameAndTag\u003e` specifies the name and tag for this image, especially useful when keeping the built images. It can be in one of the\n    \"standard\" docker formats: `repository:tag`; or `registry/repository:tag`.\n- `\u003cpush\u003e` (defaults to false) specifies whether or not the plugin should push this image to a Docker image registry. If true, the\n    image will be pushed as part of the `push-images` goal. Additionally, when true, the `\u003ckeep\u003e` property is ignored and\n    the image will be retained after the container is stopped.\n- `\u003cregistry\u003e` captures the host name and port of a private Docker registry, to which the image should be pushed, optional.\n\n## `stop-containers` goal\nThe `stop-containers` goal allows you to stop and clean up any containers that were created with the plugin. The `logs`\nparameter allows you to specify a folder where the logs of the containres need to go. They will be saved as\n`[container name].log`. If you don't specify a folder, no logs will be saved.\n\n## `commit-containers` goal\nThe `commit-containers` goals allows you to persist the state of a container to an image. Below is an example snippet.\n\n          \u003cexecution\u003e\n            \u003cid\u003ecommit\u003c/id\u003e\n            \u003cgoals\u003e\n              \u003cgoal\u003ecommit-containers\u003c/goal\u003e\n            \u003c/goals\u003e\n            \u003cconfiguration\u003e\n              \u003ccontainers\u003e\n                \u003ccontainer\u003e\n                  \u003cid\u003eapp2\u003c/id\u003e\n                  \u003crepo\u003eme/app\u003c/repo\u003e\n                  \u003ctag\u003e${maven.build.timestamp}\u003c/tag\u003e\n                  \u003ccomment\u003eDaily build\u003c/comment\u003e\n                  \u003cauthor\u003eJenkins\u003c/author\u003e\n                  \u003cpush\u003etrue\u003c/push\u003e\n                \u003c/container\u003e\n               \u003c/containers\u003e\n            \u003c/configuration\u003e\n          \u003c/execution\u003e\n\nThe configuration works as follows:\n- `\u003ccontainers\u003e` contains a list of containers to build as `\u003ccontainer\u003e` elements\n- `\u003cid\u003e` specifies the ID of a previously started container.\n- `\u003crepo\u003e` specifies the repository to push the resulting image to.\n- `\u003ctag\u003e` specifies the tag for the image, especially useful when pushing the built image to a repository.\n- `\u003ccomment\u003e` commit message\n- `\u003cauthor\u003e` author (e.g., “John Hannibal Smith \u003channibal@a-team.com\u003e“)\n- `\u003cpush\u003e` (defaults to false) specifies whether or not the plugin should push the tagged image to a Docker image registry.\n\n## `tag-images` goal\nThe `tag-images` goal allows you to assign additional tags to images and optionally flag those tags to be pushed to a Docker image registry in a subsequent\n`push-images` execution.\nBelow is an example snippet.\n\n          \u003cexecution\u003e\n            \u003cid\u003erelease\u003c/id\u003e\n            \u003cgoals\u003e\n              \u003cgoal\u003etag-images\u003c/goal\u003e\n            \u003c/goals\u003e\n            \u003cconfiguration\u003e\n              \u003cimages\u003e\n                \u003cimage\u003e\n                  \u003cid\u003enginx\u003c/id\u003e\n                  \u003ctags\u003e\n                  \t\u003ctag\u003egoonwarrior/my-nginx:1.0\u003c/tag\u003e\n                  \t\u003ctag\u003egoonwarrior/my-nginx:latest\u003c/tag\u003e\n                  \u003c/tags\u003e\n                  \u003cpush\u003etrue\u003c/push\u003e\n                  \u003cregistry\u003emydocker-registry.corp.com:5000\u003c/registry\u003e\n                \u003c/image\u003e\n              \u003c/images\u003e\n            \u003c/configuration\u003e\n          \u003c/execution\u003e\n\nThe configuration works as follows:\n- `\u003cimages\u003e` contains a list of images to build as `\u003cimage\u003e` elements\n- `\u003cid\u003e` specifies the ID of a previously built image.\n- `\u003ctags\u003e` contains a list of repository, name and/or tags to assign to the image as `\u003ctag\u003e` elements, Each can be in one of\n\tthe \"standard\" docker formats: `repository:tag`; or `registry/repository:tag`.\n- `\u003cpush\u003e` (defaults to false) specifies whether or not the plugin should push the tagged image to a Docker image registry.\n- `\u003cregistry\u003e` captures the host name and port of a private Docker registry, to which the image should be pushed, optional.\n\n## `push-images` goal\nThe `push-images` goal allows you to push any marked images that were built in a prior execution of the\n`build-images` goal to a Docker image registry.\n\nPushing an image to a private registry (that is, a registry other than https://registry.hub.docker.com/) can\nbe specified in one of two ways.\n\n1. Embedded in the `\u003cnameAndTag\u003e`\n\n          e.g.\n          `\u003cnameAndTag\u003emyregistry.corpdomain.net:5000/repo:tag\u003c/nameAndTag\u003e`\n\n1. Separately via `\u003cregistry\u003e` parameter of the image or incorporated into the `\u003cnameAndTag\u003e`.\n\n          e.g.\n          `\u003cnameAndTag\u003erepo:tag\u003c/nameAndTag\u003e`\n          `\u003cregistry\u003emyregistry.corpdomain.net\u003c/registry\u003e`\n\nThese 2 configurations behave slightly differently. In the former, the image is associated with a single\nlong tag  and all references to subsequent references to that image (e.g. in `FROM` statement in a Dockerfile)\nneed to reference the full string. In the latter case, 2 tags are registered, one long, one short, enabling\naccess to the more concise form.\n\nIf the registry is omitted, then https://registry.hub.docker.com/ is assumed.\n\n## Credentials\nSome registries (including https://registry.hub.docker.com/) will require user credentials to perform\nspecific operations. The plugin provides a means to specify these credentials however, at this time\nthey are only used when pushing images. These credentials can be specified in multiple ways.\n\n### Credentials within plugin configuration or populated indirectly by Maven properties\n\n- `\u003cuserName\u003e`, Docker registry user name, defaults to the value of `docker.userName`.\n- `\u003cpassword\u003e`, Docker registry user password (in plain text), defaults to the value of `docker.password`.\n- `\u003cemail\u003e`, Docker registry user email address, defaults to the value of `docker.email`.\n\n### Credentials in Maven's global `settings.xml`\n\nDefine a new server in `~/.m2/settings.xml`\n\n        \u003cservers\u003e\n            \u003cserver\u003e\n                \u003cid\u003edocker.mycompany.com\u003c/id\u003e\n                \u003cusername\u003e...\u003c/username\u003e\n                \u003cpassword\u003e...\u003c/password\u003e\n                \u003cconfiguration\u003e\n                    \u003cemail\u003e...\u003c/email\u003e\n                \u003c/configuration\u003e\n              \u003c/server\u003e\n        \u003c/servers\u003e\n\nRefer to this server in the plugin configuration\n\n        \u003cplugin\u003e\n            \u003cgroupId\u003enet.wouterdanes.docker\u003c/groupId\u003e\n            \u003cartifactId\u003edocker-maven-plugin\u003c/artifactId\u003e\n            \u003cversion\u003e4.1.1\u003c/version\u003e\n            \u003cconfiguration\u003e\n                \u003cserverId\u003edocker.mycompany.com\u003c/serverId\u003e\n            \u003c/configuration\u003e\n            \u003cexecutions\u003e\n                ...\n            \u003c/executions\u003e\n        \u003c/plugin\u003e\n\nPriority is given to credentials defined in plugin configuration over the ones from `settings.xml`.\n\n\n## Using a SNAPSHOT version\nThe releases of this plugin are deployed to maven central, the SNAPSHOT versions are automatically deployed to the Sonatype OSS repository. To be able to use the SNAPSHOT versions of this plugin, add the following repository to your project POM or settings.xml:\n\n      \u003cpluginRepository\u003e\n            \u003cid\u003esonatype-oss-snapshots\u003c/id\u003e\n            \u003cname\u003eSonatype OSS Snapshots\u003c/name\u003e\n            \u003curl\u003ehttps://oss.sonatype.org/content/repositories/snapshots/\u003c/url\u003e\n      \u003c/pluginRepository\u003e\n\n## Enabling the Remote Api on the Docker Daemon\nNormally, docker accepts commands via unix sockets, by default this is /var/run/docker.sock. This plugin uses the REST\nAPI that is also packaged with docker, but needs to be enabled. You can enable this by adding a -H option to the daemon\nstartup command, see http://docs.docker.io/reference/commandline/cli/#daemon. To bind the REST API to port 2375 (default)\nthat only listens to the local interface, add this to your daemon startup: `-H tcp://127.0.0.1:2375`\n\n## Skipping execution of the plugin or phases\nTo skip execution of the plugin, you can set the docker.skip property to true. This can be useful when you want to skip\nrunning tests, like: `mvn clean verify -Ddocker.skip=true -DskipTests`.\nEach individual execution can be skipped or the plugin as a whole can be skipped by configuring the `\u003cskip\u003e` property\non the `\u003cconfiguration\u003e` element of the plugin or an execution.\nAdding the following profile to your pom.xml will skip the whole plugin when the `skipTests` property is set:\n\n        \u003cprofile\u003e\n            \u003cid\u003eskip-docker-plugin-execution\u003c/id\u003e\n            \u003cactivation\u003e\n                \u003cproperty\u003eskipTests\u003c/property\u003e\n            \u003c/activation\u003e\n            \u003cproperties\u003e\n                \u003cdocker.skip\u003etrue\u003c/docker.skip\u003e\n            \u003c/properties\u003e\n        \u003c/profile\u003e\n\n# Docker providers\nCurrently the plugin supports two types of docker \"providers\", which both connect to docker via the remote API\n(HTTP REST), unix sockets are not yet supported:\n* remote (default), which publishes all ports to the host system and returns `docker_host:dynamic_port` as the port\n    mappings for all exposed ports on containers\n* local, which doesn't publish any ports to the host and returns `container_ip:exposed_port` as the port mappings for\n    all exposed ports on containers\n\nThe remote provider works for both dockers running on the same system as the client as well as boot2docker or VM based\ndockers. Just make sure DOCKER_HOST or docker.host points to the IP that is on the host-only network or that has all\ndynamic docker ports exposed (49xxx). The local provider works when the docker containers are reachable from the client\nthrough their IP address, so for example when the client runs on the docker host. Local is also a nice mode to use when\nconsumers of your containers need to connect on the \"real port\" and cannot connect to a \"dynamic port\".\n\nYou can specify the docker provider using the system property `docker.provider`, either in the pom or via the command\nline using -D, for example: `mvn clean verify -Prun-its -Ddocker.provider=local`\n\n## HTTPS support\nAs per Docker 1.3, the docker daemon can be protected with SSL encryption. For this to work, the client needs to have\nsome certificates and a private key. These by default reside in ~/.docker. Boot2docker now by default since version 1.3\nenables SSL encryption. The plugin supports this. As long as you can reach the daemon by doing `docker ps` on the command\nline, the plugin should pick up the right environment variables. The environment variables that control this behavior are:\n\n* `DOCKER_HOST` specifies where docker lives, for example: `tcp://192.168.59.103:2376`.\n* `DOCKER_TLS_VERIFY` specifies whether SSL encryption is on, the value `1` denotes that SSL encryption is enabled.\n* `DOCKER_CERT_PATH` points to the folder containing the needed `ca.pem`, `cert.pem` and `key.pem`. If not specified,\n    this defaults to `~/.docker`.\n\n# Dependencies:\n\n* [Jersey Client](https://jersey.java.net/) for a light weight API to do rest calls.\n* [Jackson](http://jackson.codehaus.org/) for parsing / creating JSON\n* [Apache Commons Compress](http://commons.apache.org/proper/commons-compress/) for creating the tar.gz archive needed to build a docker image\n\n# Building the project\n\nTo build the project, you will need Maven and Java8.\n\nTo build the project and run all the tests, run:\n\n        mvn clean verify -Prun-its\n\nThis will run the build including all integration tests. You should run this at least once before submitting a PR.\nTo just run unit tests, run:\n\n        mvn clean verify\n\n# Architecture principles\n* The plugin needs to work in CI server environments, so it needs to make sure there are no port collisions and multiple\n    builds can run on the same server in parallel. Also, docker images and containers it creates need to have unique names\n    and/or ids.\n* Multiple \"docker providers\" need to be supported and pluggable\n\n# Future functionality\n- [ ] Commit containers instead of cleaning them up when the integration tests have failed\n- [ ] Add support for linux sockets for \"local docker\" provider\n- [ ] Add support for Tutum.co\n- [ ] Create a feature complete docker remote api for Java\n- [ ] Support multiple (all) versions of the Docker Remote API\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwouterd%2Fdocker-maven-plugin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwouterd%2Fdocker-maven-plugin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwouterd%2Fdocker-maven-plugin/lists"}