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())
.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 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:
-
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
-