Package software.amazon.awscdk
Class DockerImageAssetSource.Builder
java.lang.Object
software.amazon.awscdk.DockerImageAssetSource.Builder
- All Implemented Interfaces:
software.amazon.jsii.Builder<DockerImageAssetSource>
- Enclosing interface:
DockerImageAssetSource
@Stability(Stable)
public static final class DockerImageAssetSource.Builder
extends Object
implements software.amazon.jsii.Builder<DockerImageAssetSource>
A builder for
DockerImageAssetSource
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionSets the value ofDockerImageAssetSource.getAssetName()
build()
Builds the configured instance.directoryName
(String directoryName) Sets the value ofDockerImageAssetSource.getDirectoryName()
dockerBuildArgs
(Map<String, String> dockerBuildArgs) Sets the value ofDockerImageAssetSource.getDockerBuildArgs()
dockerBuildSecrets
(Map<String, String> dockerBuildSecrets) Sets the value ofDockerImageAssetSource.getDockerBuildSecrets()
dockerBuildSsh
(String dockerBuildSsh) Sets the value ofDockerImageAssetSource.getDockerBuildSsh()
dockerBuildTarget
(String dockerBuildTarget) Sets the value ofDockerImageAssetSource.getDockerBuildTarget()
dockerCacheDisabled
(Boolean dockerCacheDisabled) Sets the value ofDockerImageAssetSource.getDockerCacheDisabled()
dockerCacheFrom
(List<? extends DockerCacheOption> dockerCacheFrom) Sets the value ofDockerImageAssetSource.getDockerCacheFrom()
dockerCacheTo
(DockerCacheOption dockerCacheTo) Sets the value ofDockerImageAssetSource.getDockerCacheTo()
dockerFile
(String dockerFile) Sets the value ofDockerImageAssetSource.getDockerFile()
dockerOutputs
(List<String> dockerOutputs) Sets the value ofDockerImageAssetSource.getDockerOutputs()
executable
(List<String> executable) Sets the value ofDockerImageAssetSource.getExecutable()
networkMode
(String networkMode) Sets the value ofDockerImageAssetSource.getNetworkMode()
Sets the value ofDockerImageAssetSource.getPlatform()
sourceHash
(String sourceHash) Sets the value ofDockerImageAssetSource.getSourceHash()
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
sourceHash
Sets the value ofDockerImageAssetSource.getSourceHash()
- Parameters:
sourceHash
- The hash of the contents of the docker build context. This parameter is required. This hash is used throughout the system to identify this image and avoid duplicate work in case the source did not change.NOTE: this means that if you wish to update your docker image, you must make a modification to the source (e.g. add some metadata to your Dockerfile).
- Returns:
this
-
assetName
Sets the value ofDockerImageAssetSource.getAssetName()
- Parameters:
assetName
- Unique identifier of the docker image asset and its potential revisions. Required if using AppScopedStagingSynthesizer.- Returns:
this
-
directoryName
Sets the value ofDockerImageAssetSource.getDirectoryName()
- Parameters:
directoryName
- The directory where the Dockerfile is stored, must be relative to the cloud assembly root.- Returns:
this
-
dockerBuildArgs
@Stability(Stable) public DockerImageAssetSource.Builder dockerBuildArgs(Map<String, String> dockerBuildArgs) Sets the value ofDockerImageAssetSource.getDockerBuildArgs()
- Parameters:
dockerBuildArgs
- Build args to pass to thedocker build
command. Since Docker build arguments are resolved before deployment, keys and values cannot refer to unresolved tokens (such aslambda.functionArn
orqueue.queueUrl
).Only allowed when
directoryName
is specified.- Returns:
this
-
dockerBuildSecrets
@Stability(Stable) public DockerImageAssetSource.Builder dockerBuildSecrets(Map<String, String> dockerBuildSecrets) Sets the value ofDockerImageAssetSource.getDockerBuildSecrets()
- Parameters:
dockerBuildSecrets
- Build secrets to pass to thedocker build
command. Since Docker build secrets are resolved before deployment, keys and values cannot refer to unresolved tokens (such aslambda.functionArn
orqueue.queueUrl
).Only allowed when
directoryName
is specified.- Returns:
this
-
dockerBuildSsh
Sets the value ofDockerImageAssetSource.getDockerBuildSsh()
- Parameters:
dockerBuildSsh
- SSH agent socket or keys to pass to thedocker buildx
command.- Returns:
this
-
dockerBuildTarget
@Stability(Stable) public DockerImageAssetSource.Builder dockerBuildTarget(String dockerBuildTarget) Sets the value ofDockerImageAssetSource.getDockerBuildTarget()
- Parameters:
dockerBuildTarget
- Docker target to build to. Only allowed whendirectoryName
is specified.- Returns:
this
-
dockerCacheDisabled
@Stability(Stable) public DockerImageAssetSource.Builder dockerCacheDisabled(Boolean dockerCacheDisabled) Sets the value ofDockerImageAssetSource.getDockerCacheDisabled()
- Parameters:
dockerCacheDisabled
- Disable the cache and pass--no-cache
to thedocker build
command.- Returns:
this
-
dockerCacheFrom
@Stability(Stable) public DockerImageAssetSource.Builder dockerCacheFrom(List<? extends DockerCacheOption> dockerCacheFrom) Sets the value ofDockerImageAssetSource.getDockerCacheFrom()
- Parameters:
dockerCacheFrom
- Cache from options to pass to thedocker build
command.- Returns:
this
-
dockerCacheTo
@Stability(Stable) public DockerImageAssetSource.Builder dockerCacheTo(DockerCacheOption dockerCacheTo) Sets the value ofDockerImageAssetSource.getDockerCacheTo()
- Parameters:
dockerCacheTo
- Cache to options to pass to thedocker build
command.- Returns:
this
-
dockerFile
Sets the value ofDockerImageAssetSource.getDockerFile()
- Parameters:
dockerFile
- Path to the Dockerfile (relative to the directory). Only allowed whendirectoryName
is specified.- Returns:
this
-
dockerOutputs
Sets the value ofDockerImageAssetSource.getDockerOutputs()
- Parameters:
dockerOutputs
- Outputs to pass to thedocker build
command.- Returns:
this
-
executable
Sets the value ofDockerImageAssetSource.getExecutable()
- Parameters:
executable
- An external command that will produce the packaged asset. The command should produce the name of a local Docker image onstdout
.- Returns:
this
-
networkMode
Sets the value ofDockerImageAssetSource.getNetworkMode()
- Parameters:
networkMode
- Networking mode for the RUN commands during build. Requires Docker Engine API v1.25+. Specify this property to build images on a specific networking mode.- Returns:
this
-
platform
Sets the value ofDockerImageAssetSource.getPlatform()
- Parameters:
platform
- Platform to build for. Requires Docker Buildx. Specify this property to build images on a specific platform.- Returns:
this
-
build
Builds the configured instance.- Specified by:
build
in interfacesoftware.amazon.jsii.Builder<DockerImageAssetSource>
- Returns:
- a new instance of
DockerImageAssetSource
- Throws:
NullPointerException
- if any required attribute was not provided
-