interface DockerImageAssetOptions
Language | Type name |
---|---|
.NET | Amazon.CDK.AWS.Ecr.Assets.DockerImageAssetOptions |
Java | software.amazon.awscdk.services.ecr.assets.DockerImageAssetOptions |
Python | aws_cdk.aws_ecr_assets.DockerImageAssetOptions |
TypeScript (source) | @aws-cdk/aws-ecr-assets » DockerImageAssetOptions |
Options for DockerImageAsset.
Example
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import * as assets from '@aws-cdk/assets';
import * as ecr_assets from '@aws-cdk/aws-ecr-assets';
import * as cdk from '@aws-cdk/core';
declare const networkMode: ecr_assets.NetworkMode;
declare const platform: ecr_assets.Platform;
const dockerImageAssetOptions: ecr_assets.DockerImageAssetOptions = {
buildArgs: {
buildArgsKey: 'buildArgs',
},
exclude: ['exclude'],
extraHash: 'extraHash',
file: 'file',
follow: assets.FollowMode.NEVER,
followSymlinks: cdk.SymlinkFollowMode.NEVER,
ignoreMode: cdk.IgnoreMode.GLOB,
invalidation: {
buildArgs: false,
extraHash: false,
file: false,
networkMode: false,
platform: false,
repositoryName: false,
target: false,
},
networkMode: networkMode,
platform: platform,
repositoryName: 'repositoryName',
target: 'target',
};
Properties
Name | Type | Description |
---|---|---|
build | { [string]: string } | Build args to pass to the docker build command. |
exclude? | string[] | Glob patterns to exclude from the copy. |
extra | string | Extra information to encode into the fingerprint (e.g. build instructions and other inputs). |
file? | string | Path to the Dockerfile (relative to the directory). |
follow? | Follow | A strategy for how to handle symlinks. |
follow | Symlink | A strategy for how to handle symlinks. |
ignore | Ignore | The ignore behavior to use for exclude patterns. |
invalidation? | Docker | Options to control which parameters are used to invalidate the asset hash. |
network | Network | Networking mode for the RUN commands during build. |
platform? | Platform | Platform to build for. |
repository | string | ECR repository name. |
target? | string | Docker target to build to. |
buildArgs?
Type:
{ [string]: string }
(optional, default: no build args are passed)
Build args to pass to the docker build
command.
Since Docker build arguments are resolved before deployment, keys and
values cannot refer to unresolved tokens (such as lambda.functionArn
or
queue.queueUrl
).
exclude?
Type:
string[]
(optional, default: nothing is excluded)
Glob patterns to exclude from the copy.
extraHash?
Type:
string
(optional, default: hash is only based on source content)
Extra information to encode into the fingerprint (e.g. build instructions and other inputs).
file?
Type:
string
(optional, default: 'Dockerfile')
Path to the Dockerfile (relative to the directory).
follow?
⚠️ Deprecated: use followSymlinks
instead
Type:
Follow
(optional, default: Never)
A strategy for how to handle symlinks.
followSymlinks?
Type:
Symlink
(optional, default: SymlinkFollowMode.NEVER)
A strategy for how to handle symlinks.
ignoreMode?
Type:
Ignore
(optional, default: IgnoreMode.GLOB)
The ignore behavior to use for exclude patterns.
invalidation?
Type:
Docker
(optional, default: hash all parameters)
Options to control which parameters are used to invalidate the asset hash.
networkMode?
Type:
Network
(optional, default: no networking mode specified (the default networking mode NetworkMode.DEFAULT
will be used))
Networking mode for the RUN commands during build.
Support docker API 1.25+.
platform?
Type:
Platform
(optional, default: no platform specified (the current machine architecture will be used))
Platform to build for.
Requires Docker Buildx.
repositoryName?
⚠️ Deprecated: to control the location of docker image assets, please override
Stack.addDockerImageAsset
. this feature will be removed in future
releases.
Type:
string
(optional, default: the default ECR repository for CDK assets)
ECR repository name.
Specify this property if you need to statically address the image, e.g. from a Kubernetes Pod. Note, this is only the repository name, without the registry and the tag parts.
target?
Type:
string
(optional, default: no target)
Docker target to build to.