Class PodmanBuildCommand.Builder
- java.lang.Object
-
- nl.lexemmens.podman.command.podman.PodmanBuildCommand.Builder
-
- Enclosing class:
- PodmanBuildCommand
public static class PodmanBuildCommand.Builder extends Object
Builder class used to create an instance of thePodmanBuildCommand
-
-
Constructor Summary
Constructors Constructor Description Builder(org.apache.maven.plugin.logging.Log log, PodmanConfiguration podmanConfig, CommandExecutorDelegate delegate)Construct a new instance of this builder
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description PodmanBuildCommand.BuilderaddBuildArgs(Map<String,String> args)PodmanBuildCommand.BuilderaddUlimitsArgs(Map<String,String> ulimits)Commandbuild()Returns the constructed commandPodmanBuildCommand.BuildersetContainerFile(Path containerFile)Sets the Containerfile that should be buildPodmanBuildCommand.BuildersetContextDir(String contextDir)Sets the context directory to usePodmanBuildCommand.BuildersetFormat(String format)Sets the format of the containers metadataPodmanBuildCommand.BuildersetLayers(Boolean layers)Sets the layers optionPodmanBuildCommand.BuildersetNoCache(boolean noCache)Sets whether or not to cache intermediate layersPodmanBuildCommand.BuildersetPlatform(String platform)Sets the platform for the resulting image rather using the default of the build systemPodmanBuildCommand.BuildersetPullPolicy(String pullPolicy)Sets whether the base image should be pulledPodmanBuildCommand.BuildersetSquash()Sets whether all layers should be squashedPodmanBuildCommand.BuildersetSquashAll()Sets whether all layers should be squashedPodmanBuildCommand.BuildersetTargetStage(String targetStage)Sets the platform for the resulting image rather using the default of the build system
-
-
-
Constructor Detail
-
Builder
public Builder(org.apache.maven.plugin.logging.Log log, PodmanConfiguration podmanConfig, CommandExecutorDelegate delegate)Construct a new instance of this builder- Parameters:
log- The Maven logpodmanConfig- The Podman configurationdelegate- The executor delegate
-
-
Method Detail
-
setSquash
public PodmanBuildCommand.Builder setSquash()
Sets whether all layers should be squashed- Returns:
- This builder instance
-
setSquashAll
public PodmanBuildCommand.Builder setSquashAll()
Sets whether all layers should be squashed- Returns:
- This builder instance
-
setLayers
public PodmanBuildCommand.Builder setLayers(Boolean layers)
Sets the layers option- Parameters:
layers- Sets the value of the layers option- Returns:
- This builder instance
-
setFormat
public PodmanBuildCommand.Builder setFormat(String format)
Sets the format of the containers metadata- Parameters:
format- The value of the format option to set- Returns:
- This builder instance
-
setContextDir
public PodmanBuildCommand.Builder setContextDir(String contextDir)
Sets the context directory to use- Parameters:
contextDir- the context directory to set- Returns:
- This builder instance
-
setContainerFile
public PodmanBuildCommand.Builder setContainerFile(Path containerFile)
Sets the Containerfile that should be build- Parameters:
containerFile- The pointer towards the containerfile to use- Returns:
- This builder instance
-
setPullPolicy
public PodmanBuildCommand.Builder setPullPolicy(String pullPolicy)
Sets whether the base image should be pulled- Parameters:
pullPolicy- Sets whether to pull the image- Returns:
- This builder instance
-
setNoCache
public PodmanBuildCommand.Builder setNoCache(boolean noCache)
Sets whether or not to cache intermediate layers- Parameters:
noCache- Sets whether the noCache option should be used- Returns:
- This builder instance
-
setPlatform
public PodmanBuildCommand.Builder setPlatform(String platform)
Sets the platform for the resulting image rather using the default of the build system- Parameters:
platform- A valid combination of GO OS and GO ARCH for example linux/arm64 (https://golang.org/doc/install/source#environment)- Returns:
- This builder instance
-
setTargetStage
public PodmanBuildCommand.Builder setTargetStage(String targetStage)
Sets the platform for the resulting image rather using the default of the build system- Parameters:
targetStage- Sets the target build stage to build in a multi-stage build.- Returns:
- This builder instance
-
addBuildArgs
public PodmanBuildCommand.Builder addBuildArgs(Map<String,String> args)
-
addUlimitsArgs
public PodmanBuildCommand.Builder addUlimitsArgs(Map<String,String> ulimits)
-
build
public Command build()
Returns the constructed command- Returns:
- The constructed command
-
-