Class DockerImageSource.Builder
- java.lang.Object
-
- software.amazon.awscdk.cloudassembly.schema.DockerImageSource.Builder
-
- All Implemented Interfaces:
software.amazon.jsii.Builder<DockerImageSource>
- Enclosing interface:
- DockerImageSource
@Stability(Stable) public static final class DockerImageSource.Builder extends Object implements software.amazon.jsii.Builder<DockerImageSource>
A builder forDockerImageSource
-
-
Constructor Summary
Constructors Constructor Description Builder()
-
Method Summary
-
-
-
Method Detail
-
cacheDisabled
@Stability(Stable) public DockerImageSource.Builder cacheDisabled(Boolean cacheDisabled)
Sets the value ofDockerImageSource.getCacheDisabled()- Parameters:
cacheDisabled- Disable the cache and pass--no-cacheto thedocker buildcommand.- Returns:
this
-
cacheFrom
@Stability(Stable) public DockerImageSource.Builder cacheFrom(List<? extends DockerCacheOption> cacheFrom)
Sets the value ofDockerImageSource.getCacheFrom()- Parameters:
cacheFrom- Cache from options to pass to thedocker buildcommand.- Returns:
this
-
cacheTo
@Stability(Stable) public DockerImageSource.Builder cacheTo(DockerCacheOption cacheTo)
Sets the value ofDockerImageSource.getCacheTo()- Parameters:
cacheTo- Cache to options to pass to thedocker buildcommand.- Returns:
this
-
directory
@Stability(Stable) public DockerImageSource.Builder directory(String directory)
Sets the value ofDockerImageSource.getDirectory()- Parameters:
directory- The directory containing the Docker image build instructions. This path is relative to the asset manifest location.- Returns:
this
-
dockerBuildArgs
@Stability(Stable) public DockerImageSource.Builder dockerBuildArgs(Map<String,String> dockerBuildArgs)
Sets the value ofDockerImageSource.getDockerBuildArgs()- Parameters:
dockerBuildArgs- Additional build arguments. Only allowed whendirectoryis set.- Returns:
this
-
dockerBuildSecrets
@Stability(Stable) public DockerImageSource.Builder dockerBuildSecrets(Map<String,String> dockerBuildSecrets)
Sets the value ofDockerImageSource.getDockerBuildSecrets()- Parameters:
dockerBuildSecrets- Additional build secrets. Only allowed whendirectoryis set.- Returns:
this
-
dockerBuildSsh
@Stability(Stable) public DockerImageSource.Builder dockerBuildSsh(String dockerBuildSsh)
Sets the value ofDockerImageSource.getDockerBuildSsh()- Parameters:
dockerBuildSsh- SSH agent socket or keys. Requires building with docker buildkit.- Returns:
this
-
dockerBuildTarget
@Stability(Stable) public DockerImageSource.Builder dockerBuildTarget(String dockerBuildTarget)
Sets the value ofDockerImageSource.getDockerBuildTarget()- Parameters:
dockerBuildTarget- Target build stage in a Dockerfile with multiple build stages. Only allowed whendirectoryis set.- Returns:
this
-
dockerFile
@Stability(Stable) public DockerImageSource.Builder dockerFile(String dockerFile)
Sets the value ofDockerImageSource.getDockerFile()- Parameters:
dockerFile- The name of the file with build instructions. Only allowed whendirectoryis set.- Returns:
this
-
dockerOutputs
@Stability(Stable) public DockerImageSource.Builder dockerOutputs(List<String> dockerOutputs)
Sets the value ofDockerImageSource.getDockerOutputs()- Parameters:
dockerOutputs- Outputs.- Returns:
this
-
executable
@Stability(Stable) public DockerImageSource.Builder executable(List<String> executable)
Sets the value ofDockerImageSource.getExecutable()- Parameters:
executable- A command-line executable that returns the name of a local Docker image on stdout after being run.- Returns:
this
-
networkMode
@Stability(Stable) public DockerImageSource.Builder networkMode(String networkMode)
Sets the value ofDockerImageSource.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
@Stability(Stable) public DockerImageSource.Builder platform(String platform)
Sets the value ofDockerImageSource.getPlatform()- Parameters:
platform- Platform to build for. Requires Docker Buildx. Specify this property to build images on a specific platform/architecture.- Returns:
this
-
build
@Stability(Stable) public DockerImageSource build()
Builds the configured instance.- Specified by:
buildin interfacesoftware.amazon.jsii.Builder<DockerImageSource>- Returns:
- a new instance of
DockerImageSource - Throws:
NullPointerException- if any required attribute was not provided
-
-