Package io.fabric8.maven.docker.service
Class BuildService
- java.lang.Object
-
- io.fabric8.maven.docker.service.BuildService
-
public class BuildService extends Object
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classBuildService.BuildContext
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description FilebuildArchive(ImageConfiguration imageConfiguration, BuildService.BuildContext buildContext, String archivePath)Create docker archive for building imagevoidbuildImage(ImageConfiguration imageConfig, ImagePullManager imagePullManager, BuildService.BuildContext buildContext, File buildArchiveFile)Pull the base image if needed and run the build.protected voidbuildImage(ImageConfiguration imageConfig, MojoParameters params, boolean noCache, boolean squash, Map<String,String> buildArgs, File dockerArchive)Build an imagevoidcopyDockerArchive(ImageConfiguration imageConfiguration, File dockerArchive, String archivePath)voidtagImage(ImageConfiguration imageConfig)voidtagImage(String imageName, String tag, String repo)
-
-
-
Method Detail
-
buildImage
public void buildImage(ImageConfiguration imageConfig, ImagePullManager imagePullManager, BuildService.BuildContext buildContext, File buildArchiveFile) throws DockerAccessException, org.apache.maven.plugin.MojoExecutionException
Pull the base image if needed and run the build.- Parameters:
imageConfig- the image configurationbuildContext- the build context- Throws:
DockerAccessExceptionorg.apache.maven.plugin.MojoExecutionException
-
buildArchive
public File buildArchive(ImageConfiguration imageConfiguration, BuildService.BuildContext buildContext, String archivePath) throws org.apache.maven.plugin.MojoExecutionException
Create docker archive for building image- Parameters:
imageConfiguration- image configurationbuildContext- docker build contextarchivePath- build archive only flag, it can have values TRUE or FALSE and also it can hold path to archive where it might get copied over- Returns:
- tarball for docker image
- Throws:
org.apache.maven.plugin.MojoExecutionException- in case any exception comes during building tarball
-
copyDockerArchive
public void copyDockerArchive(ImageConfiguration imageConfiguration, File dockerArchive, String archivePath) throws IOException
- Throws:
IOException
-
tagImage
public void tagImage(ImageConfiguration imageConfig) throws DockerAccessException
- Throws:
DockerAccessException
-
buildImage
protected void buildImage(ImageConfiguration imageConfig, MojoParameters params, boolean noCache, boolean squash, Map<String,String> buildArgs, File dockerArchive) throws DockerAccessException, org.apache.maven.plugin.MojoExecutionException
Build an image- Parameters:
imageConfig- the image configurationparams- mojo params for the projectnoCache- if not null, dictate the caching behaviour. Otherwise its taken from the build configurationbuildArgs- docker build args- Throws:
DockerAccessExceptionorg.apache.maven.plugin.MojoExecutionException
-
tagImage
public void tagImage(String imageName, String tag, String repo) throws DockerAccessException
- Throws:
DockerAccessException
-
-