bundle.md
57 lines
| 1.4 KiB
| text/x-minidsrc
|
MarkdownLexer
|
|
r14 | # Creating bundle from images | ||
| ## NAME | ||||
| Save set of images to the single archive. | ||||
| ## SYNOPSIS | ||||
| ```gradle | ||||
| plugins { | ||||
| // task types and base extension | ||||
| id "org.implab.gradle-container-base" | ||||
| } | ||||
| container { | ||||
| cliCmd = "podman" | ||||
| } | ||||
| // create configuration | ||||
| configurations { | ||||
| bundleImages { | ||||
| canBeResolved = true | ||||
| canBeConsumed = false | ||||
| } | ||||
| } | ||||
| // add dependencies to the project | ||||
| dependencies { | ||||
| bundleImages project(":images:foo"), project(":images:bar") | ||||
| } | ||||
| // create task to export bundle | ||||
| task bundle(type: SaveImage) { | ||||
| // add image refs from artifacts | ||||
| imageRefs configurations.bundleImages | ||||
| // add image name | ||||
| exportImages.add "nginx:latest" | ||||
| } | ||||
| ``` | ||||
| ## DESCRIPTION | ||||
| To create an archive with images the task of type `SaveImage` can be used. This | ||||
| task has the following properties: | ||||
| | Property | Description | | ||||
| |-|-| | ||||
| | `archiveFileName` | The file name of the bundle archive, defaults to `{archiveBaseName}-{archiveVersion}-{archiveClassifier}.{archiveExtension}`.| | ||||
| | `archiveBaseName` | The base name of the archive, defaults to `{project.group}-{project.name}`. | | ||||
| | `archiveVersion` | The archive version, defaults to `{project.version}`. | | ||||
| | `exportImages` | A set of image names to include in the bundle. | | ||||
| | Method | Description | | ||||
| |-|-| | ||||
| | `imageRefs(FileCollection)` | Adds a set of files with image refs to add to the bundle. | | ||||
| | `imageRef(File)` | Adds an image name from the file with image reference. | | ||||
