You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add the ability to attach a saved image archive as a project artifact (#1210)
This PR is to add the ability to attach an image archive produced by docker:save to the project as an artifact. Currently this is not possible and archives have to be attached using something like build-helper-maven-plugin.
To avoid conflict with docker:source, the default attach classifier is `archive` (or `archive-<saveAlias>`), instead of `docker` (or `docker-<alias>`) as used by that mojo.
Copy file name to clipboardExpand all lines: doc/changelog.md
+1Lines changed: 1 addition & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,6 +4,7 @@
4
4
- 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))
5
5
- Fix NPE if docker:save is called with -Dfile=file-name-only.tar ([#1203](https://github.com/fabric8io/docker-maven-plugin/issues/1203))
6
6
- Improve GZIP compression performance for docker:save ([#1205](https://github.com/fabric8io/docker-maven-plugin/issues/1205))
7
+
- Allow docker:save to attach image archive as a project artifact ([#1210](https://github.com/fabric8io/docker-maven-plugin/pull/1210))
7
8
- 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))
Copy file name to clipboardExpand all lines: src/main/asciidoc/inc/_docker-save.adoc
+29Lines changed: 29 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -10,6 +10,31 @@ If the option `saveFile` is not set, the file name is calculated automatically:
10
10
11
11
Please note that the exported image contains all image layers and can be quite large (also, it takes a bit to export the image).
12
12
13
+
.Controlling image compression
14
+
The file name extension is used to select a compression method for the output.
15
+
[cols="3,2,1"]
16
+
|===
17
+
| Extensions | Compression | Type
18
+
19
+
| .tar or unrecognized
20
+
| No compression
21
+
| .tar
22
+
23
+
| .tar.gz, .tgz
24
+
| GZIP compression
25
+
| .tar.gz
26
+
27
+
| .tar.bz, .tar.bz2, .tar.bzip2
28
+
| BZIP2 compression
29
+
| .tar.bz
30
+
31
+
|===
32
+
33
+
.Attaching the saved image as an artifact
34
+
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.
35
+
36
+
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>>.
37
+
13
38
.Save options
14
39
[cols="1,5,1"]
15
40
|===
@@ -27,6 +52,10 @@ Please note that the exported image contains all image layers and can be quite l
27
52
| The filename to save.
28
53
| `docker.save.file` or `docker.file` or `file`
29
54
55
+
| *saveClassifier*
56
+
| 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.
57
+
| `docker.save.classifier`
58
+
30
59
| *skipSave*
31
60
| A boolean flag whether to skip execution of the goal.
thrownewMojoExecutionException("More than one image with build configuration is defined. Please specify the image with 'docker.name' or 'docker.alias'.");
0 commit comments