Global configuration parameters specify overall behavior like the connection to the Docker host. The corresponding system properties which can be used to set it from the outside are given in parentheses.
The docker-maven-plugin uses the Docker remote API so the URL of your
Docker Daemon must somehow be specified. The URL can be specified by
the dockerHost or machine configuration, or by the DOCKER_HOST
environment variable.
The Docker remote API supports communication via SSL and
authentication with certificates. The path to the certificates can
be specified by the certPath or machine configuration, or by the
DOCKER_CERT_PATH
environment variable.
Element | Description | Property |
---|---|---|
apiVersion |
Use this variable if you are using an older version of docker not compatible with the current default use to communicate with the server. |
|
authConfig |
Authentication information when pulling from or pushing to Docker registry. There is a dedicated section Authentication for how doing security. |
|
autoCreate CustomNetworks |
Create automatically Docker networks during |
|
autoPull |
Decide how to pull missing base images or images to start. This option is deprecated, please use imagePullPolicy instead. The following values are supported:
|
|
buildArchiveOnly |
Skip the actual Docker image build and only create the archive holding the Dockerfile and build context. The following values are supported:
|
|
certPath |
Path to SSL certificate when SSL is used for communicating with the Docker daemon. These certificates are normally stored in |
|
dockerHost |
The URL of the Docker Daemon. If this configuration option is not given, then the optional
|
|
filter |
In order to temporarily restrict the operation of plugin goals this configuration option can be used. Typically this will be set via the system property |
|
Specify whether images should be pull when looking for base images while building or images for starting. This property can take the following values (case insensitive):
By default a progress meter is printed out on the console, which is omitted when using Maven in batch mode (option |
|
|
logDate |
Date format which is used for printing out container logs. This configuration can be overwritten by individual run configurations and described below. The format is described in Logging. |
|
logStdout |
For all container logging to standard output if set to |
|
machine |
Docker machine configuration. See Docker Machine for possible values |
|
maxConnections |
Number of parallel connections are allowed to be opened to the Docker Host. For parsing log output, a connection needs to be kept open (as well for the wait features), so don’t put that number to low. Default is 100 which should be suitable for most of the cases. |
|
jib |
Delegate Image Build process to JIB, |
|
jibImageFormat |
Format of the image to be built. Values can be |
|
outputDirectory |
Default output directory to be used by this plugin. The default value is |
|
portPropertyFile |
Global property file into which the mapped properties should be written to. The format of this file and its purpose are also described in Port Mapping. |
|
registry |
Specify globally a registry to use for pulling and pushing images. See Registry handling for details. |
|
skip |
With this parameter the execution of this plugin can be skipped completely. |
|
skipBuild |
If set no images will be build (which implies also skip.tag) with |
|
skipPush |
If set dont push any images even when |
|
skipPom |
If set to |
|
skipRun |
If set dont create and start any containers with |
|
skipTag |
If set to |
|
skipMachine |
Skip using docker machine in any case |
|
sourceDirectory |
Default directory that contains the assembly descriptor(s) used by the plugin. The default value is |
|
useColor |
Whether to use colored log output. By default this is switched on when running on a console, off otherwise. |
|
outputFile |
If specified, this parameter will cause the logs to be written to the path specified, instead of writing to the console. |
|
verbose |
String attribute for switching on verbose output on standard output (stdout). It takes a comma separated list of string values to switch on various verbosity groups. The currently known groups are: build:: Print out Docker build instructions api:: API calls to the Docker daemons are logged all:: All levels are enabled If you set an empty string (or only e.g. Default is that verbose logging is disabled. |
|
<configuration>
<dockerHost>https://localhost:2376</dockerHost>
<certPath>src/main/dockerCerts</certPath>
<useColor>true</useColor>
.....
</configuration>
This plugin supports also Docker machine (which must be installed locally, of course). A Docker machine configuration can be provided with a top-level <machine>
configuration section. This configuration section knows the following options:
Element | Description |
---|---|
name |
Docker machine’s name. Default is |
autoCreate |
if set to |
regenerateCertsAfterStart |
if set to |
createOptions |
Map with options for Docker machine when auto-creating a machine. See the docker machine documentation for possible options. |
When no Docker host is configured or available as an environment variable, then the configured Docker machine is used. If the machine exists but is not running, it is started automatically. If it does not exists but autoCreate
is true, then the machine is created and started. Otherwise, an error is printed. Please note, that a machine which has been created because of autoCreate
gets never deleted by docker-maven-plugin. This needs to be done manually if required.
In absence of a <machine>
configuration section the Maven property docker.machine.name
can be used to provide the name of a Docker machine. Similarly, the property docker.machine.autoCreate
can be set to true for creating a Docker machine, too.
You can use the property docker.skip.machine
if you want to override the internal detection mechanism to always disable docker machine support.
<!-- Work with a docker-machine -->
<configuration>
<machine>
<name>maven</name>
<autoCreate>true</autoCreate>
<createOptions>
<driver>virtualbox</driver>
<virtualbox-cpu-count>2</virtualbox-cpu-count>
</createOptions>
</machine>
.....
</configuration>