Skip to content

Commit

Permalink
Merge branch 'master' into pullReq626
Browse files Browse the repository at this point in the history
  • Loading branch information
rhuss committed Apr 21, 2019
2 parents 5e0aac5 + 885954a commit 58abffd
Show file tree
Hide file tree
Showing 48 changed files with 1,907 additions and 163 deletions.
22 changes: 15 additions & 7 deletions doc/changelog.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
# ChangeLog

* **0.28-SNAPSHOT**
* **0.29-SNAPSHOT**
- Restore ANSI color to Maven logging if disabled during plugin execution and enable color for Windows with Maven 3.5.0 or later. Color logging is enabled by default, but disabled if the Maven CLI disables color (e.g. in batch mode) ([#1108](https://github.com/fabric8io/docker-maven-plugin/issues/1108))
- Fix NPE if docker:save is called with -Dfile=file-name-only.tar ([#1203](https://github.com/fabric8io/docker-maven-plugin/issues/1203))
- Improve GZIP compression performance for docker:save ([#1205](https://github.com/fabric8io/docker-maven-plugin/issues/1205))
- Allow docker:save to attach image archive as a project artifact ([#1210](https://github.com/fabric8io/docker-maven-plugin/pull/1210))
- Use pattern to detect image name in archive loaded during build and tag with image name from the project configuration ([#1207](https://github.com/fabric8io/docker-maven-plugin/issues/1207))

* **0.29.0** (2019-04-08)
- Avoid failing docker:save when no images with build configuration are present ([#1185](https://github.com/fabric8io/docker-maven-plugin/issues/1185))
- Reintroduce minimal API-VERSION parameter in order to support docker versions below apiVersion 1.25
- docs: Correct default image naming
- Proxy settings are being ignored ([#1148](https://github.com/fabric8io/docker-maven-plugin/issues/1148))
Expand All @@ -10,12 +18,12 @@
- Update to jnr-unixsocket 0.22
- Support for new docker build --pull option (#1191)
- Enhance @sha256 digest for tags in FROM (image_name:image_tag@sha256<digest>) ([#541](https://github.com/fabric8io/docker-maven-plugin/issues/541))
- Support docker SHELL setting for runCmds (#1157)
- Added 'autoRemove' option for running containers (#1179)
- Added support for AWS EC2 instance roles when pushing to AWS ECR (#1186)
- Introduce `contextDir` configuration option which would be used to specify docker build context (#1189)
- Add support for auto-pulling multiple base image for multi stage builds (#1057)
- Fix usage of credential helper that do not support 'version' command (#1159)
- Support docker SHELL setting for runCmds ([#1157](https://github.com/fabric8io/docker-maven-plugin/issues/1157))
- Added 'autoRemove' option for running containers ([#1179](https://github.com/fabric8io/docker-maven-plugin/issues/1179))
- Added support for AWS EC2 instance roles when pushing to AWS ECR ([#1186](https://github.com/fabric8io/docker-maven-plugin/issues/1186))
- Introduce `contextDir` configuration option which would be used to specify docker build context ([#1189](https://github.com/fabric8io/docker-maven-plugin/issues/1189))
- Add support for auto-pulling multiple base image for multi stage builds ([#1057](https://github.com/fabric8io/docker-maven-plugin/issues/1057))
- Fix usage of credential helper that do not support 'version' command ([#1159](https://github.com/fabric8io/docker-maven-plugin/issues/1159))

Please note that `dockerFileDir` is now deprecated in favor of `contextDir` which also allows absolute paths to Dockerfile with
`dockerFile` and it will be removed in 1.0.0. It's still supported in this release but users are suggested to migrate to
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>io.fabric8</groupId>
<artifactId>docker-maven-plugin</artifactId>
<version>0.28-SNAPSHOT</version>
<version>0.29-SNAPSHOT</version>
<packaging>maven-plugin</packaging>

<name>docker-maven-plugin</name>
Expand Down
4 changes: 2 additions & 2 deletions samples/cargo-jolokia/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,13 @@
<parent>
<groupId>io.fabric8.dmp.samples</groupId>
<artifactId>dmp-sample-parent</artifactId>
<version>0.28-SNAPSHOT</version>
<version>0.29-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

<groupId>io.fabric8</groupId>
<artifactId>dmp-sample-cargo-jolokia</artifactId>
<version>0.28-SNAPSHOT</version>
<version>0.29-SNAPSHOT</version>

<url>http://www.jolokia.org</url>

Expand Down
4 changes: 2 additions & 2 deletions samples/custom-net/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@
<parent>
<groupId>io.fabric8.dmp.samples</groupId>
<artifactId>dmp-sample-parent</artifactId>
<version>0.28-SNAPSHOT</version>
<version>0.29-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

<artifactId>dmp-custom-net</artifactId>
<version>0.28-SNAPSHOT</version>
<version>0.29-SNAPSHOT</version>

<build>
<plugins>
Expand Down
4 changes: 2 additions & 2 deletions samples/data-jolokia/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,12 @@
<parent>
<groupId>io.fabric8.dmp.samples</groupId>
<artifactId>dmp-sample-parent</artifactId>
<version>0.28-SNAPSHOT</version>
<version>0.29-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

<artifactId>dmp-sample-data-jolokia</artifactId>
<version>0.28-SNAPSHOT</version>
<version>0.29-SNAPSHOT</version>
<!-- add custom lifecycle -->
<packaging>docker</packaging>

Expand Down
4 changes: 2 additions & 2 deletions samples/docker-compose/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,12 @@
<parent>
<groupId>io.fabric8.dmp.samples</groupId>
<artifactId>dmp-sample-parent</artifactId>
<version>0.28-SNAPSHOT</version>
<version>0.29-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

<artifactId>dmp-sample-docker-compose</artifactId>
<version>0.28-SNAPSHOT</version>
<version>0.29-SNAPSHOT</version>

<url>http://www.jolokia.org</url>

Expand Down
4 changes: 2 additions & 2 deletions samples/dockerfile/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@
<parent>
<groupId>io.fabric8.dmp.samples</groupId>
<artifactId>dmp-sample-parent</artifactId>
<version>0.28-SNAPSHOT</version>
<version>0.29-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

<artifactId>dockerfile</artifactId>
<version>0.28-SNAPSHOT</version>
<version>0.29-SNAPSHOT</version>
<packaging>war</packaging>
<name>dmp-sample-dockerfile</name>

Expand Down
4 changes: 2 additions & 2 deletions samples/dockerignore/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@
<parent>
<groupId>io.fabric8.dmp.samples</groupId>
<artifactId>dmp-sample-parent</artifactId>
<version>0.28-SNAPSHOT</version>
<version>0.29-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

<artifactId>dmp-sample-dockerignore</artifactId>
<version>0.28-SNAPSHOT</version>
<version>0.29-SNAPSHOT</version>
<packaging>docker-build</packaging>

<build>
Expand Down
4 changes: 2 additions & 2 deletions samples/healthcheck/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@
<parent>
<groupId>io.fabric8.dmp.samples</groupId>
<artifactId>dmp-sample-parent</artifactId>
<version>0.28-SNAPSHOT</version>
<version>0.29-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

<artifactId>dmp-sample-healthcheck</artifactId>
<version>0.28-SNAPSHOT</version>
<version>0.29-SNAPSHOT</version>


<build>
Expand Down
4 changes: 2 additions & 2 deletions samples/helloworld/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@
<parent>
<groupId>io.fabric8.dmp.samples</groupId>
<artifactId>dmp-sample-parent</artifactId>
<version>0.28-SNAPSHOT</version>
<version>0.29-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>


<artifactId>dmp-sample-helloworld</artifactId>
<version>0.28-SNAPSHOT</version>
<version>0.29-SNAPSHOT</version>
<packaging>jar</packaging>
<name>dmp-sample-helloworld</name>

Expand Down
4 changes: 2 additions & 2 deletions samples/log/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@
<parent>
<groupId>io.fabric8.dmp.samples</groupId>
<artifactId>dmp-sample-parent</artifactId>
<version>0.28-SNAPSHOT</version>
<version>0.29-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>


<groupId>io.fabric8</groupId>
<artifactId>dmp-sample-log</artifactId>
<version>0.28-SNAPSHOT</version>
<version>0.29-SNAPSHOT</version>

<build>
<plugins>
Expand Down
4 changes: 2 additions & 2 deletions samples/multi-wait/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
<modelVersion>4.0.0</modelVersion>
<groupId>io.fabric8</groupId>
<artifactId>dmp-sample-multi-wait</artifactId>
<version>0.28-SNAPSHOT</version>
<version>0.29-SNAPSHOT</version>
<!-- Sample exhibiting connection error described in https://github.com/fabric8io/docker-maven-plugin/issues/574 -->
<parent>
<groupId>io.fabric8.dmp.samples</groupId>
<artifactId>dmp-sample-parent</artifactId>
<version>0.28-SNAPSHOT</version>
<version>0.29-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<build>
Expand Down
4 changes: 2 additions & 2 deletions samples/net/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@
<parent>
<groupId>io.fabric8.dmp.samples</groupId>
<artifactId>dmp-sample-parent</artifactId>
<version>0.28-SNAPSHOT</version>
<version>0.29-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

<artifactId>dmp-sample-net</artifactId>
<version>0.28-SNAPSHOT</version>
<version>0.29-SNAPSHOT</version>

<profiles>
<profile>
Expand Down
2 changes: 1 addition & 1 deletion samples/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

<groupId>io.fabric8.dmp.samples</groupId>
<artifactId>dmp-sample-parent</artifactId>
<version>0.28-SNAPSHOT</version>
<version>0.29-SNAPSHOT</version>
<packaging>pom</packaging>

<url>http://www.jolokia.org</url>
Expand Down
4 changes: 2 additions & 2 deletions samples/properties/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@
<parent>
<groupId>io.fabric8.dmp.samples</groupId>
<artifactId>dmp-sample-parent</artifactId>
<version>0.28-SNAPSHOT</version>
<version>0.29-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

<artifactId>dmp-sample-properties</artifactId>
<version>0.28-SNAPSHOT</version>
<version>0.29-SNAPSHOT</version>
<packaging>docker-build</packaging>

<build>
Expand Down
4 changes: 2 additions & 2 deletions samples/run-java/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@
<parent>
<groupId>io.fabric8.dmp.samples</groupId>
<artifactId>dmp-sample-parent</artifactId>
<version>0.28-SNAPSHOT</version>
<version>0.29-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

<groupId>io.fabric8.dmp.samples</groupId>
<artifactId>dmp-sample-run-java</artifactId>
<packaging>jar</packaging>
<version>0.28-SNAPSHOT</version>
<version>0.29-SNAPSHOT</version>

<build>

Expand Down
4 changes: 2 additions & 2 deletions samples/smallest/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
<parent>
<groupId>io.fabric8.dmp.samples</groupId>
<artifactId>dmp-sample-parent</artifactId>
<version>0.28-SNAPSHOT</version>
<version>0.29-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

<groupId>fabric8io</groupId>
<artifactId>dmp-sample-smallest</artifactId>
<version>0.28-SNAPSHOT</version>
<version>0.29-SNAPSHOT</version>

<build>
<plugins>
Expand Down
4 changes: 2 additions & 2 deletions samples/volume/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@
<parent>
<groupId>io.fabric8.dmp.samples</groupId>
<artifactId>dmp-sample-parent</artifactId>
<version>0.28-SNAPSHOT</version>
<version>0.29-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

<artifactId>dmp-sample-volume</artifactId>
<version>0.28-SNAPSHOT</version>
<version>0.29-SNAPSHOT</version>

<build>
<plugins>
Expand Down
4 changes: 2 additions & 2 deletions samples/zero-config/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@
<parent>
<groupId>io.fabric8.dmp.samples</groupId>
<artifactId>dmp-sample-parent</artifactId>
<version>0.28-SNAPSHOT</version>
<version>0.29-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>


<groupId>io.fabric8.dmp.samples</groupId>
<artifactId>demp-sample-zero-config</artifactId>
<packaging>jar</packaging>
<version>0.28-SNAPSHOT</version>
<version>0.29-SNAPSHOT</version>

<properties>
<jar_file>${project.build.directory}/${project.build.finalName}.jar</jar_file>
Expand Down
29 changes: 29 additions & 0 deletions src/main/asciidoc/inc/_docker-save.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,31 @@ If the option `saveFile` is not set, the file name is calculated automatically:

Please note that the exported image contains all image layers and can be quite large (also, it takes a bit to export the image).

.Controlling image compression
The file name extension is used to select a compression method for the output.
[cols="3,2,1"]
|===
| Extensions | Compression | Type

| .tar or unrecognized
| No compression
| .tar

| .tar.gz, .tgz
| GZIP compression
| .tar.gz

| .tar.bz, .tar.bz2, .tar.bzip2
| BZIP2 compression
| .tar.bz

|===

.Attaching the saved image as an artifact
If `saveClassifier` is set, the saved archive will be attached to the project using the provided classifier and the type determined from the file name. The placeholder `%a` will be replaced with the image alias.

Note that using overriding the default to use `docker` or `docker-%a` may lead to a conflict if a source archive is also attached with <<{plugin}:source>>.

.Save options
[cols="1,5,1"]
|===
Expand All @@ -27,6 +52,10 @@ Please note that the exported image contains all image layers and can be quite l
| The filename to save.
| `docker.save.file` or `docker.file` or `file`

| *saveClassifier*
| If set, attach the the saved archive to the project with the provided classifier. A placeholder of `%a` will be replaced with the image alias.
| `docker.save.classifier`

| *skipSave*
| A boolean flag whether to skip execution of the goal.
| `docker.skip.save`
Expand Down
20 changes: 17 additions & 3 deletions src/main/asciidoc/inc/build/_configuration.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ https://docs.docker.com/engine/reference/api/docker_remote_api_v1.24/#build-imag
| *cleanup*
| Cleanup dangling (untagged) images after each build (including any containers created from them). Default is `try` which tries to remove the old image, but doesn't fail the build if this is not possible because e.g. the image is still used by a running container. Use `remove` if you want to fail the build and `none` if no cleanup is requested.

| [[context-dir]]*contextDir*
| Path to a directory used for the build's context. You can specify the `Dockerfile` to use with *dockerFile*, which by default is the Dockerfile found in the `contextDir`. The Dockerfile can be also located outside of the `contextDir`, if provided with an absolute file path. See <<external-dockerfile, External Dockerfile>> for details.

| <<misc-startup, *cmd*>>
| A command to execute by default (i.e. if no command is provided when a container for this image is started). See <<misc-startup,Startup Arguments>> for details.

Expand All @@ -34,9 +37,8 @@ https://docs.docker.com/engine/reference/api/docker_remote_api_v1.24/#build-imag
| *dockerFile*
| Path to a `Dockerfile` which also triggers _Dockerfile mode_. See <<external-dockerfile, External Dockerfile>> for details.

| *dockerFileDir*
| Path to a directory holding a `Dockerfile` and switch on _Dockerfile mode_. See <<external-dockerfile, External Dockerfile>> for details.

| *dockerFileDir* (_deprecated_ in favor of *<<context-dir, contextDir>>*)
| Path to a directory holding a `Dockerfile` and switch on _Dockerfile mode_. See <<external-dockerfile, External Dockerfile>> for details. _This option is deprecated in favor of _contextDir_ and will be removed for the next major release_.

| *dockerArchive*
| Path to a saved image archive which is then imported. See <<external-dockerfile, Docker archive>> for details.
Expand Down Expand Up @@ -75,6 +77,18 @@ A provided `<from>` takes precedence over the name given here. This tag is usefu
| *imagePullPolicy*
| Specific pull policy for the base image. This overwrites any global pull policy. See the globale configuration option <<image-pull-policy, imagePullPolicy>> for the possible values and the default.

| *loadNamePattern*
a| Scan the images in the archive specified in `dockerArchive` and match the associated repository and tag information against this pattern. When a matching repository and tag is found, create a tag linking the `name` for this image to the repository and tag that matched the pattern.

The wildcards are:

* `?` matches a single character
* `*` matches within one component, where components are separated by slashes, or the final colon that separates the repository from the tag
* `**` matches multiple components, stopping at the final colon
* `**/` matches multiple components, but must stop at a slash, or the final colon
When matching multiple components, `$$**/$$` is likely to be more useful than `$$**$$`. The pattern `$$**image-name:*$$` will match `my-group/my-image-name:some-tag`, whereas `$$**/image-name:*$$` will not, because the wildcard has to stop at a slash. Note that `$$**/image-name:*$$` will also match 'image-name:some-tag', since the `$$**/$$` wildcard can be empty.

| <<misc-env, *labels*>>
| Labels as described in <<misc-env,Setting Environment Variables and Labels>>.

Expand Down
6 changes: 3 additions & 3 deletions src/main/asciidoc/inc/build/_overview.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ When using this mode, the Dockerfile is created on the fly with all instructions
Alternatively an external Dockerfile template or Docker archive can be used. This mode is switched on by using one of these three configuration options within

* *contextDir* specifies docker build context if an external dockerfile is located outside of Docker build context. If not specified, Dockerfile's parent directory is used as build context.
* *dockerFile* specifies a specific Dockerfile path.
* *dockerArchive* specifies a previously saved image archive to load directly. Such a tar archive can be created with `docker save`. If a `dockerArchive` is provided, no `dockerFile` or `dockerFileDir` must be given.
* *dockerFileDir* (*deprecated*, use *contextDir*) specifies a directory containing a Dockerfile that will be used to create the image. The name of the Dockerfile is `Dockerfile` by default but can be also set with the option `dockerFile` (see below).
* *dockerFile* specifies a specific Dockerfile path. The Docker build context directory is set to `contextDir` if given. If not the directory by default is the directory in which the Dockerfile is stored.
* *dockerArchive* specifies a previously saved image archive to load directly. Such a tar archive can be created with `docker save` or the <<{plugin}:save>> goal. If a `dockerArchive` is provided, no `dockerFile` or `dockerFileDir` must be given.
* *dockerFileDir* (_deprecated_, use *contextDir*) specifies a directory containing a Dockerfile that will be used to create the image. The name of the Dockerfile is `Dockerfile` by default but can be also set with the option `dockerFile` (see below).
All paths can be either absolute or relative paths (except when both `dockerFileDir` and `dockerFile` are provided in which case `dockerFile` must not be absolute). A relative path is looked up in `${project.basedir}/src/main/docker` by default. You can make it easily an absolute path by using `${project.basedir}` in your configuration.

Expand Down
Loading

0 comments on commit 58abffd

Please sign in to comment.