Class DockerAssemblyManager


  • @Component(role=DockerAssemblyManager.class,
               instantiationStrategy="per-lookup")
    public class DockerAssemblyManager
    extends Object
    Tool for creating a docker image tar ball including a Dockerfile for building a docker image.
    Since:
    08.05.14
    Author:
    roland
    • Constructor Detail

      • DockerAssemblyManager

        public DockerAssemblyManager()
    • Method Detail

      • extractDockerTarArchive

        public void extractDockerTarArchive​(File archiveFile,
                                            File destinationDirectory)
                                     throws org.apache.maven.plugin.MojoExecutionException
        Extract a docker tar archive into the given directory.
        Parameters:
        archiveFile - a tar archive to extract
        destinationDirectory - directory where to place extracted content
        Throws:
        org.apache.maven.plugin.MojoExecutionException - if an error occurs during extracting.
      • createDockerTarArchive

        public File createDockerTarArchive​(String imageName,
                                           MojoParameters params,
                                           BuildImageConfiguration buildConfig,
                                           Logger log)
                                    throws org.apache.maven.plugin.MojoExecutionException
        Create an docker tar archive from the given configuration which can be send to the Docker host for creating the image.
        Parameters:
        imageName - Name of the image to create (used for creating build directories)
        params - Mojos parameters (used for finding the directories)
        buildConfig - configuration for how to build the image
        log - Logger used to display warning if permissions are to be normalized
        Returns:
        file holding the path to the created assembly tar file
        Throws:
        org.apache.maven.plugin.MojoExecutionException
      • createDockerTarArchive

        public File createDockerTarArchive​(String imageName,
                                           MojoParameters params,
                                           BuildImageConfiguration buildConfig,
                                           Logger log,
                                           ArchiverCustomizer finalCustomizer)
                                    throws org.apache.maven.plugin.MojoExecutionException
        Create an docker tar archive from the given configuration which can be send to the Docker host for creating the image.
        Parameters:
        imageName - Name of the image to create (used for creating build directories)
        params - Mojos parameters (used for finding the directories)
        buildConfig - configuration for how to build the image
        log - Logger used to display warning if permissions are to be normalized
        finalCustomizer - finalCustomizer to be applied to the tar archive
        Returns:
        file holding the path to the created assembly tar file
        Throws:
        org.apache.maven.plugin.MojoExecutionException
      • getAssemblyFiles

        public AssemblyFiles getAssemblyFiles​(@Nonnull
                                              String name,
                                              AssemblyConfiguration assemblyConfig,
                                              MojoParameters mojoParams,
                                              Logger log)
                                       throws org.apache.maven.plugins.assembly.InvalidAssemblerConfigurationException,
                                              org.apache.maven.plugins.assembly.archive.ArchiveCreationException,
                                              org.apache.maven.plugins.assembly.format.AssemblyFormattingException,
                                              org.apache.maven.plugin.MojoExecutionException
        Extract all files with a tracking archiver. These can be used to track changes in the filesystem and triggering a rebuild of the image if needed ('docker:watch')
        Throws:
        org.apache.maven.plugins.assembly.InvalidAssemblerConfigurationException
        org.apache.maven.plugins.assembly.archive.ArchiveCreationException
        org.apache.maven.plugins.assembly.format.AssemblyFormattingException
        org.apache.maven.plugin.MojoExecutionException
      • createChangedFilesArchive

        public File createChangedFilesArchive​(List<AssemblyFiles.Entry> entries,
                                              File assemblyDirectory,
                                              String imageName,
                                              MojoParameters mojoParameters)
                                       throws org.apache.maven.plugin.MojoExecutionException
        Throws:
        org.apache.maven.plugin.MojoExecutionException