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")
.displayName("displayName")
.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
Nested ClassesModifier and TypeInterfaceDescriptionstatic final classA builder forDockerImageAssetSourcestatic final classAn implementation forDockerImageAssetSource -
Method Summary
Modifier and TypeMethodDescriptionbuilder()default StringUnique identifier of the docker image asset and its potential revisions.default StringThe directory where the Dockerfile is stored, must be relative to the cloud assembly root.default StringA display name for this asset.Build args to pass to thedocker buildcommand.Build secrets to pass to thedocker buildcommand.default StringSSH agent socket or keys to pass to thedocker buildxcommand.default StringDocker target to build to.default BooleanDisable the cache and pass--no-cacheto thedocker buildcommand.default List<DockerCacheOption> Cache from options to pass to thedocker buildcommand.default DockerCacheOptionCache to options to pass to thedocker buildcommand.default StringPath to the Dockerfile (relative to the directory).Outputs to pass to thedocker buildcommand.An external command that will produce the packaged asset.default StringNetworking mode for the RUN commands during build.default StringPlatform 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
-
getDisplayName
A display name for this asset.If supplied, the display name will be used in locations where the asset identifier is printed, like in the CLI progress information.
Default: - The asset hash is used to display the asset
-
getDockerBuildArgs
Build args to pass to thedocker buildcommand.Since Docker build arguments are resolved before deployment, keys and values cannot refer to unresolved tokens (such as
lambda.functionArnorqueue.queueUrl).Only allowed when
directoryNameis specified.Default: - no build args are passed
-
getDockerBuildSecrets
Build secrets to pass to thedocker buildcommand.Since Docker build secrets are resolved before deployment, keys and values cannot refer to unresolved tokens (such as
lambda.functionArnorqueue.queueUrl).Only allowed when
directoryNameis specified.Default: - no build secrets are passed
-
getDockerBuildSsh
SSH agent socket or keys to pass to thedocker buildxcommand.Default: - no ssh arg is passed
-
getDockerBuildTarget
Docker target to build to.Only allowed when
directoryNameis specified.Default: - no target
-
getDockerCacheDisabled
Disable the cache and pass--no-cacheto thedocker buildcommand.Default: - cache is used
-
getDockerCacheFrom
Cache from options to pass to thedocker buildcommand.Default: - no cache from args are passed
-
getDockerCacheTo
Cache to options to pass to thedocker buildcommand.Default: - no cache to args are passed
-
getDockerFile
Path to the Dockerfile (relative to the directory).Only allowed when
directoryNameis specified.Default: - no file
-
getDockerOutputs
Outputs to pass to thedocker buildcommand.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.BuilderofDockerImageAssetSource
-