Class DockerBuildAssetOptions.Builder
java.lang.Object
software.amazon.awscdk.services.lambda.DockerBuildAssetOptions.Builder
- All Implemented Interfaces:
software.amazon.jsii.Builder<DockerBuildAssetOptions>
- Enclosing interface:
DockerBuildAssetOptions
@Stability(Stable)
public static final class DockerBuildAssetOptions.Builder
extends Object
implements software.amazon.jsii.Builder<DockerBuildAssetOptions>
A builder for
DockerBuildAssetOptions
-
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 ofDockerBuildAssetOptions.getImagePath()
outputPath
(String outputPath) Sets the value ofDockerBuildAssetOptions.getOutputPath()
Sets the value ofDockerBuildOptions.getPlatform()
targetStage
(String targetStage) Sets the value ofDockerBuildOptions.getTargetStage()
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
imagePath
Sets the value ofDockerBuildAssetOptions.getImagePath()
- Parameters:
imagePath
- The path in the Docker image where the asset is located after the build operation.- Returns:
this
-
outputPath
Sets the value ofDockerBuildAssetOptions.getOutputPath()
- Parameters:
outputPath
- The path on the local filesystem where the asset will be copied usingdocker cp
.- Returns:
this
-
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 DockerBuildAssetOptions.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<DockerBuildAssetOptions>
- Returns:
- a new instance of
DockerBuildAssetOptions
- Throws:
NullPointerException
- if any required attribute was not provided
-