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 class
A builder forDockerImageAssetOptions
static final class
An implementation forDockerImageAssetOptions
-
Method Summary
Modifier and TypeMethodDescriptionbuilder()
default String
Unique identifier of the docker image asset and its potential revisions.Build args to pass to thedocker build
command.Build secrets.default String
SSH agent socket or keys to pass to thedocker build
command.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
getFile()
Path to the Dockerfile (relative to the directory).Options to control which parameters are used to invalidate the asset hash.default NetworkMode
Networking mode for the RUN commands during build.Outputs to pass to thedocker build
command.default Platform
Platform to build for.default String
Docker target to build to.Methods inherited from interface software.amazon.awscdk.FileCopyOptions
getExclude, getFollowSymlinks, getIgnoreMode
Methods inherited from interface software.amazon.awscdk.FileFingerprintOptions
getExtraHash
Methods 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 build
command.Since Docker build arguments are resolved before deployment, keys and values cannot refer to unresolved tokens (such as
lambda.functionArn
orqueue.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 build
command.Docker BuildKit must be enabled to use the ssh flag
Default: - no --ssh flag
- See Also:
-
getCacheDisabled
Disable the cache and pass--no-cache
to thedocker build
command.Default: - cache is used
-
getCacheFrom
Cache from options to pass to thedocker build
command.Default: - no cache from options are passed to the build command
- See Also:
-
getCacheTo
Cache to options to pass to thedocker build
command.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 build
command.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.Builder
ofDockerImageAssetOptions
-