Build
This goal will build all images which have a <build>
configuration section. There must be a Containerfile
present in order to build a container image.
Building a container image without a Containerfile , thus purely on configuration is currently not supported.
|
Build Configuration
This section covers all the possible options for the <build>
tag.
Element | Description |
---|---|
noCache |
Do not use existing cached images for the container build. Build from the start with a new set of cached layers. Default value is: |
pull |
When the option is specified or set to “true”, pull the image. Raise an error if the image could not be pulled, even if the image is present locally. If the option is disabled (with When this option is specified and Default value is: See: https://docs.podman.io/en/latest/markdown/podman-build.1.html |
pullAlways |
Pull the image from the first registry it is found in as listed in registries.conf. Raise an error if not found in the registries, even if the image is present locally. When this option is specified and Default value is: See: https://docs.podman.io/en/latest/markdown/podman-build.1.html |
tags |
An array consisting of one or more tags to attach to the built container image. Tags will be appended at the end of the image name. |
containerFile |
The name of the Default value is: |
containerFileDir |
Path of the directory where the Default value is: Project base directory |
A collection of labels to add to this image. They are specified in the typical maven property format. |
|
tagWithMavenProjectVersion |
When set to Default value is: |
createLatestTag |
Specifies whether the resultig container image should be tagged with Default value is: |
format |
Control the format for the built image’s manifest and configuration data. Supported values are:
Default value is: |
<configuration>
...
<images>
<image>
<name>your-image-name</name>
<build>
<pull>true</pull>
<pullAlways>false</pullAlways>
<tags>
<sampleTag>sampleTagValue</sampleTag>
</tags>
<createLatestTag>true</createLatestTag>
<format>OCI</format>
</build>
</image>
</images>
...
</configuration>
Batch Configuration
When using the <batch/>
configuration option, some configuration options are interpreted slightly different, compared to the explanation in the table above. The table below lists all these configuration options that are interpreted differently.
Please be advised that you can only configure one run directory for podman (see General Configuration). This needs to be taken into account when designing your Containerfile s
|
Element | Description |
---|---|
|
The directory in which all |
Labels
Labels are a mechanism for applying metadata to container images. Labels can be used to order images. A label is a key-value pair, stored as a string. You can specify multiple labels for an object, but each key-value pair must be unique within an object. If the same key is given multiple values, the most-recently-written value overwrites all previous values.
Key format recommendations
A label key is the left-hand side of the key-value pair. Keys are alphanumeric strings which may contain periods (.
) and hyphens (-
). Most Podman users use images created by other organizations, and the following guidelines help to prevent inadvertent duplication of labels across objects, especially if you plan to use labels as a mechanism for automation.
Value guidelines
Label values can contain any data type that can be represented as a string, including (but not limited to) JSON, XML, CSV, or YAML. The only requirement is that the value be serialized to a string first, using a mechanism specific to the type of structure. For instance, to serialize JSON into a string, you might use the JSON.stringify()
JavaScript method.
Since Podman does not deserialize the value, you cannot treat a JSON or XML document as a nested structure when querying or filtering by label value unless you build this functionality into third-party tooling.