Class ContainerfileDecorator


  • public class ContainerfileDecorator
    extends Object

    Class that brings support for decorating Containerfile. This means that it can:

    • Decorate a specified source Containerfile by resolving properties configured in the MavenProject
    • Decorate a specified source Containerfile by adding one or more label commands to the Containerfile

    With respect to properties: Both properties specified via the properties tag in a pom file as well as the default Maven properties are supported

    • Constructor Detail

      • ContainerfileDecorator

        public ContainerfileDecorator​(org.apache.maven.plugin.logging.Log log,
                                      org.apache.maven.shared.filtering.MavenFileFilter mavenFileFilter,
                                      org.apache.maven.project.MavenProject mavenProject)
        Constructs a new instance of this FilterSupport class.
        Parameters:
        log - The logger
        mavenFileFilter - Maven's File Filtering service
        mavenProject - The MavenProject
    • Method Detail

      • decorateContainerfile

        public void decorateContainerfile​(SingleImageConfiguration image)
                                   throws org.apache.maven.plugin.MojoExecutionException

        Decorates a Dockerfile by executing a series of actions to get to the final Dockerfile:

        • Use the MavenFileFilter service to filter the source Dockerfile and copy it to the target location.
        • Add labels to the target Dockerfile using the LABELS command.
        Parameters:
        image - The BuildContext that contains the source and target Dockerfile paths
        Throws:
        org.apache.maven.plugin.MojoExecutionException - When the Dockerfile cannot be filtered.