Package software.amazon.awscdk
Class DockerBuildOptions.Builder
java.lang.Object
software.amazon.awscdk.DockerBuildOptions.Builder
- All Implemented Interfaces:
software.amazon.jsii.Builder<DockerBuildOptions>
- Enclosing interface:
DockerBuildOptions
@Stability(Stable)
public static final class DockerBuildOptions.Builder
extends Object
implements software.amazon.jsii.Builder<DockerBuildOptions>
A builder for
DockerBuildOptions
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionbuild()
Builds the configured instance.Sets the value ofDockerBuildOptions.getBuildArgs()
cacheDisabled
(Boolean cacheDisabled) Sets the value ofDockerBuildOptions.getCacheDisabled()
cacheFrom
(List<? extends DockerCacheOption> cacheFrom) Sets the value ofDockerBuildOptions.getCacheFrom()
cacheTo
(DockerCacheOption cacheTo) Sets the value ofDockerBuildOptions.getCacheTo()
Sets the value ofDockerBuildOptions.getFile()
Sets the value ofDockerBuildOptions.getPlatform()
targetStage
(String targetStage) Sets the value ofDockerBuildOptions.getTargetStage()
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
buildArgs
Sets the value ofDockerBuildOptions.getBuildArgs()
- Parameters:
buildArgs
- Build args.- Returns:
this
-
cacheDisabled
Sets the value ofDockerBuildOptions.getCacheDisabled()
- Parameters:
cacheDisabled
- Disable the cache and pass--no-cache
to thedocker build
command.- Returns:
this
-
cacheFrom
@Stability(Stable) public DockerBuildOptions.Builder cacheFrom(List<? extends DockerCacheOption> cacheFrom) Sets the value ofDockerBuildOptions.getCacheFrom()
- Parameters:
cacheFrom
- Cache from options to pass to thedocker build
command.- Returns:
this
-
cacheTo
Sets the value ofDockerBuildOptions.getCacheTo()
- Parameters:
cacheTo
- Cache to options to pass to thedocker build
command.- Returns:
this
-
file
Sets the value ofDockerBuildOptions.getFile()
- Parameters:
file
- Name of the Dockerfile, must relative to the docker build path.- Returns:
this
-
platform
Sets the value ofDockerBuildOptions.getPlatform()
- Parameters:
platform
- Set platform if server is multi-platform capable. Requires Docker Engine API v1.38+. Example value:linux/amd64
- Returns:
this
-
targetStage
Sets the value ofDockerBuildOptions.getTargetStage()
- Parameters:
targetStage
- Set build target for multi-stage container builds. Any stage defined afterwards will be ignored. Example value:build-env
- Returns:
this
-
build
Builds the configured instance.- Specified by:
build
in interfacesoftware.amazon.jsii.Builder<DockerBuildOptions>
- Returns:
- a new instance of
DockerBuildOptions
- Throws:
NullPointerException
- if any required attribute was not provided
-