Package io.fabric8.maven.docker.assembly
Class DockerAssemblyManager
- java.lang.Object
-
- io.fabric8.maven.docker.assembly.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
-
-
Field Summary
Fields Modifier and Type Field Description static StringDEFAULT_DATA_BASE_IMAGEstatic StringDOCKER_EXCLUDEstatic StringDOCKER_IGNOREstatic StringDOCKER_INCLUDEstatic StringDOCKERFILE_NAMEstatic StringSCRATCH_IMAGE
-
Constructor Summary
Constructors Constructor Description DockerAssemblyManager()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description FilecreateChangedFilesArchive(List<AssemblyFiles.Entry> entries, File assemblyDirectory, String imageName, MojoParameters mojoParameters)FilecreateDockerTarArchive(String imageName, MojoParameters params, BuildImageConfiguration buildConfig, Logger log)Create an docker tar archive from the given configuration which can be send to the Docker host for creating the image.FilecreateDockerTarArchive(String imageName, MojoParameters params, BuildImageConfiguration buildConfig, Logger log, ArchiverCustomizer finalCustomizer)Create an docker tar archive from the given configuration which can be send to the Docker host for creating the image.voidextractDockerTarArchive(File archiveFile, File destinationDirectory)Extract a docker tar archive into the given directory.AssemblyFilesgetAssemblyFiles(String name, AssemblyConfiguration assemblyConfig, MojoParameters mojoParams, Logger log)Extract all files with a tracking archiver.
-
-
-
Field Detail
-
DEFAULT_DATA_BASE_IMAGE
public static final String DEFAULT_DATA_BASE_IMAGE
- See Also:
- Constant Field Values
-
SCRATCH_IMAGE
public static final String SCRATCH_IMAGE
- See Also:
- Constant Field Values
-
DOCKER_IGNORE
public static final String DOCKER_IGNORE
- See Also:
- Constant Field Values
-
DOCKER_EXCLUDE
public static final String DOCKER_EXCLUDE
- See Also:
- Constant Field Values
-
DOCKER_INCLUDE
public static final String DOCKER_INCLUDE
- See Also:
- Constant Field Values
-
DOCKERFILE_NAME
public static final String DOCKERFILE_NAME
- See Also:
- Constant Field Values
-
-
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 extractdestinationDirectory- 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 imagelog- 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 imagelog- Logger used to display warning if permissions are to be normalizedfinalCustomizer- 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.InvalidAssemblerConfigurationExceptionorg.apache.maven.plugins.assembly.archive.ArchiveCreationExceptionorg.apache.maven.plugins.assembly.format.AssemblyFormattingExceptionorg.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
-
-