Interface DockerImageAssetSource
- All Superinterfaces:
software.amazon.jsii.JsiiSerializable
- All Known Implementing Classes:
DockerImageAssetSource.Jsii$Proxy
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import software.amazon.awscdk.*; DockerImageAssetSource dockerImageAssetSource = DockerImageAssetSource.builder() .sourceHash("sourceHash") // the properties below are optional .assetName("assetName") .directoryName("directoryName") .dockerBuildArgs(Map.of( "dockerBuildArgsKey", "dockerBuildArgs")) .dockerBuildSecrets(Map.of( "dockerBuildSecretsKey", "dockerBuildSecrets")) .dockerBuildSsh("dockerBuildSsh") .dockerBuildTarget("dockerBuildTarget") .dockerCacheDisabled(false) .dockerCacheFrom(List.of(DockerCacheOption.builder() .type("type") // the properties below are optional .params(Map.of( "paramsKey", "params")) .build())) .dockerCacheTo(DockerCacheOption.builder() .type("type") // the properties below are optional .params(Map.of( "paramsKey", "params")) .build()) .dockerFile("dockerFile") .dockerOutputs(List.of("dockerOutputs")) .executable(List.of("executable")) .networkMode("networkMode") .platform("platform") .build();
-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic final class
A builder forDockerImageAssetSource
static final class
An implementation forDockerImageAssetSource
-
Method Summary
Modifier and TypeMethodDescriptionbuilder()
default String
Unique identifier of the docker image asset and its potential revisions.default String
The directory where the Dockerfile is stored, must be relative to the cloud assembly root.Build args to pass to thedocker build
command.Build secrets to pass to thedocker build
command.default String
SSH agent socket or keys to pass to thedocker buildx
command.default String
Docker target to build to.default Boolean
Disable the cache and pass--no-cache
to thedocker build
command.default List<DockerCacheOption>
Cache from options to pass to thedocker build
command.default DockerCacheOption
Cache to options to pass to thedocker build
command.default String
Path to the Dockerfile (relative to the directory).Outputs to pass to thedocker build
command.An external command that will produce the packaged asset.default String
Networking mode for the RUN commands during build.default String
Platform to build for.The hash of the contents of the docker build context.Methods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJson
-
Method Details
-
getSourceHash
The hash of the contents of the docker build context.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).
-
getAssetName
Unique identifier of the docker image asset and its potential revisions.Required if using AppScopedStagingSynthesizer.
Default: - no asset name
-
getDirectoryName
The directory where the Dockerfile is stored, must be relative to the cloud assembly root.Default: - Exactly one of `directoryName` and `executable` is required
-
getDockerBuildArgs
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 as
lambda.functionArn
orqueue.queueUrl
).Only allowed when
directoryName
is specified.Default: - no build args are passed
-
getDockerBuildSecrets
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 as
lambda.functionArn
orqueue.queueUrl
).Only allowed when
directoryName
is specified.Default: - no build secrets are passed
-
getDockerBuildSsh
SSH agent socket or keys to pass to thedocker buildx
command.Default: - no ssh arg is passed
-
getDockerBuildTarget
Docker target to build to.Only allowed when
directoryName
is specified.Default: - no target
-
getDockerCacheDisabled
Disable the cache and pass--no-cache
to thedocker build
command.Default: - cache is used
-
getDockerCacheFrom
Cache from options to pass to thedocker build
command.Default: - no cache from args are passed
-
getDockerCacheTo
Cache to options to pass to thedocker build
command.Default: - no cache to args are passed
-
getDockerFile
Path to the Dockerfile (relative to the directory).Only allowed when
directoryName
is specified.Default: - no file
-
getDockerOutputs
Outputs to pass to thedocker build
command.Default: - no build args are passed
-
getExecutable
An external command that will produce the packaged asset.The command should produce the name of a local Docker image on
stdout
.Default: - Exactly one of `directoryName` and `executable` is required
-
getNetworkMode
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.
Default: - no networking mode specified
-
getPlatform
Platform to build for. Requires Docker Buildx.Specify this property to build images on a specific platform.
Default: - no platform specified (the current machine architecture will be used)
-
builder
- Returns:
- a
DockerImageAssetSource.Builder
ofDockerImageAssetSource
-