Interface DockerImageAssetOptions
- All Superinterfaces:
FileCopyOptions,FileFingerprintOptions,software.amazon.jsii.JsiiSerializable
- All Known Subinterfaces:
AssetImageCodeProps,AssetImageProps,DockerImageAssetProps
- All Known Implementing Classes:
AssetImageCodeProps.Jsii$Proxy,AssetImageProps.Jsii$Proxy,DockerImageAssetOptions.Jsii$Proxy,DockerImageAssetProps.Jsii$Proxy
Example:
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import software.amazon.awscdk.*;
import software.amazon.awscdk.services.ecr.assets.*;
NetworkMode networkMode;
Platform platform;
DockerImageAssetOptions dockerImageAssetOptions = DockerImageAssetOptions.builder()
.assetName("assetName")
.buildArgs(Map.of(
"buildArgsKey", "buildArgs"))
.buildSecrets(Map.of(
"buildSecretsKey", "buildSecrets"))
.buildSsh("buildSsh")
.cacheDisabled(false)
.cacheFrom(List.of(DockerCacheOption.builder()
.type("type")
// the properties below are optional
.params(Map.of(
"paramsKey", "params"))
.build()))
.cacheTo(DockerCacheOption.builder()
.type("type")
// the properties below are optional
.params(Map.of(
"paramsKey", "params"))
.build())
.displayName("displayName")
.exclude(List.of("exclude"))
.extraHash("extraHash")
.file("file")
.followSymlinks(SymlinkFollowMode.NEVER)
.ignoreMode(IgnoreMode.GLOB)
.invalidation(DockerImageAssetInvalidationOptions.builder()
.buildArgs(false)
.buildSecrets(false)
.buildSsh(false)
.extraHash(false)
.file(false)
.networkMode(false)
.outputs(false)
.platform(false)
.repositoryName(false)
.target(false)
.build())
.networkMode(networkMode)
.outputs(List.of("outputs"))
.platform(platform)
.target("target")
.build();
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic final classA builder forDockerImageAssetOptionsstatic final classAn implementation forDockerImageAssetOptions -
Method Summary
Modifier and TypeMethodDescriptionbuilder()default StringUnique identifier of the docker image asset and its potential revisions.Build args to pass to thedocker buildcommand.Build secrets.default StringSSH agent socket or keys to pass to thedocker buildcommand.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 StringA display name for this asset.default StringgetFile()Path to the Dockerfile (relative to the directory).Options to control which parameters are used to invalidate the asset hash.default NetworkModeNetworking mode for the RUN commands during build.Outputs to pass to thedocker buildcommand.default PlatformPlatform to build for.default StringDocker target to build to.Methods inherited from interface software.amazon.awscdk.FileCopyOptions
getExclude, getFollowSymlinks, getIgnoreModeMethods inherited from interface software.amazon.awscdk.FileFingerprintOptions
getExtraHashMethods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJson
-
Method Details
-
getAssetName
Unique identifier of the docker image asset and its potential revisions.Required if using AppScopedStagingSynthesizer.
Default: - no asset name
-
getBuildArgs
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).Default: - no build args are passed
-
getBuildSecrets
Build secrets.Docker BuildKit must be enabled to use build secrets.
Default: - no build secrets
Example:
import software.amazon.awscdk.DockerBuildSecret; Map<String, String> buildSecrets = Map.of( "MY_SECRET", DockerBuildSecret.fromSrc("file.txt"));- See Also:
-
getBuildSsh
SSH agent socket or keys to pass to thedocker buildcommand.Docker BuildKit must be enabled to use the ssh flag
Default: - no --ssh flag
- See Also:
-
getCacheDisabled
Disable the cache and pass--no-cacheto thedocker buildcommand.Default: - cache is used
-
getCacheFrom
Cache from options to pass to thedocker buildcommand.Default: - no cache from options are passed to the build command
- See Also:
-
getCacheTo
Cache to options to pass to thedocker buildcommand.Default: - no cache to options are passed to the build command
- See Also:
-
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. If the same asset is added multiple times, the display name of the first occurrence is used.
If
assetNameis given, it will also be used as the defaultdisplayName. Otherwise, the default is the construct path of the ImageAsset construct, with respect to the enclosing stack. If the asset is produced by a construct helper function (such aslambda.Code.fromAssetImage()), this will look likeMyFunction/AssetImage.We use the stack-relative construct path so that in the common case where you have multiple stacks with the same asset, we won't show something like
/MyBetaStack/MyFunction/Codewhen you are actually deploying to production.Default: - Stack-relative construct path
-
getFile
Path to the Dockerfile (relative to the directory).Default: 'Dockerfile'
-
getInvalidation
Options to control which parameters are used to invalidate the asset hash.Default: - hash all parameters
-
getNetworkMode
Networking mode for the RUN commands during build.Support docker API 1.25+.
Default: - no networking mode specified (the default networking mode `NetworkMode.DEFAULT` will be used)
-
getOutputs
Outputs to pass to thedocker buildcommand.Default: - no outputs are passed to the build command (default outputs are used)
- See Also:
-
getPlatform
Platform to build for.Requires Docker Buildx.
Default: - no platform specified (the current machine architecture will be used)
-
getTarget
Docker target to build to.Default: - no target
-
builder
- Returns:
- a
DockerImageAssetOptions.BuilderofDockerImageAssetOptions
-