interface DockerBuildOptions
Language | Type name |
---|---|
.NET | Amazon.CDK.DockerBuildOptions |
Go | github.com/aws/aws-cdk-go/awscdk/v2#DockerBuildOptions |
Java | software.amazon.awscdk.DockerBuildOptions |
Python | aws_cdk.DockerBuildOptions |
TypeScript (source) | aws-cdk-lib » DockerBuildOptions |
Docker build options.
Example
new lambda.Function(this, 'Function', {
code: lambda.Code.fromAsset('/path/to/handler', {
bundling: {
image: DockerImage.fromBuild('/path/to/dir/with/DockerFile', {
buildArgs: {
ARG1: 'value1',
},
}),
command: ['my', 'cool', 'command'],
},
}),
runtime: lambda.Runtime.PYTHON_3_9,
handler: 'index.handler',
});
Properties
Name | Type | Description |
---|---|---|
build | { [string]: string } | Build args. |
cache | boolean | Disable the cache and pass --no-cache to the docker build command. |
cache | Docker [] | Cache from options to pass to the docker build command. |
cache | Docker | Cache to options to pass to the docker build command. |
file? | string | Name of the Dockerfile, must relative to the docker build path. |
platform? | string | Set platform if server is multi-platform capable. Requires Docker Engine API v1.38+. |
target | string | Set build target for multi-stage container builds. Any stage defined afterwards will be ignored. |
buildArgs?
Type:
{ [string]: string }
(optional, default: no build args)
Build args.
cacheDisabled?
Type:
boolean
(optional, default: cache is used)
Disable the cache and pass --no-cache
to the docker build
command.
cacheFrom?
Type:
Docker
[]
(optional, default: no cache from args are passed)
Cache from options to pass to the docker build
command.
cacheTo?
Type:
Docker
(optional, default: no cache to args are passed)
Cache to options to pass to the docker build
command.
file?
Type:
string
(optional, default: Dockerfile
)
Name of the Dockerfile, must relative to the docker build path.
platform?
Type:
string
(optional, default: no platform specified)
Set platform if server is multi-platform capable. Requires Docker Engine API v1.38+.
Example value: linux/amd64
targetStage?
Type:
string
(optional, default: Build all stages defined in the Dockerfile)
Set build target for multi-stage container builds. Any stage defined afterwards will be ignored.
Example value: build-env