interface DockerBuildAssetOptions
| Language | Type name |
|---|---|
.NET | Amazon.CDK.AWS.Lambda.DockerBuildAssetOptions |
Go | github.com/aws/aws-cdk-go/awscdk/v2/awslambda#DockerBuildAssetOptions |
Java | software.amazon.awscdk.services.lambda.DockerBuildAssetOptions |
Python | aws_cdk.aws_lambda.DockerBuildAssetOptions |
TypeScript (source) | aws-cdk-lib » aws_lambda » DockerBuildAssetOptions |
Implements
Docker
Options when creating an asset from a Docker build.
Example
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_lambda as lambda } from 'aws-cdk-lib';
const dockerBuildAssetOptions: lambda.DockerBuildAssetOptions = {
buildArgs: {
buildArgsKey: 'buildArgs',
},
buildContexts: {
buildContextsKey: 'buildContexts',
},
cacheDisabled: false,
cacheFrom: [{
type: 'type',
// the properties below are optional
params: {
paramsKey: 'params',
},
}],
cacheTo: {
type: 'type',
// the properties below are optional
params: {
paramsKey: 'params',
},
},
file: 'file',
imagePath: 'imagePath',
network: 'network',
outputPath: 'outputPath',
platform: 'platform',
targetStage: 'targetStage',
};
Properties
| Name | Type | Description |
|---|---|---|
| build | { [string]: string } | Build args. |
| build | { [string]: string } | Build contexts to pass to the docker build command. |
| 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. |
| image | string | The path in the Docker image where the asset is located after the build operation. |
| network? | string | Docker Networking options. |
| output | string | The path on the local filesystem where the asset will be copied using docker cp. |
| 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.
buildContexts?
Type:
{ [string]: string }
(optional, default: no additional build contexts)
Build contexts to pass to the docker build command.
Build contexts can be used to specify additional directories or images to use during the build. Each entry specifies a named build context and its source (a directory path, a URL, or a docker image).
See also: https://docs.docker.com/build/building/context/#additional-build-contexts
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.
imagePath?
Type:
string
(optional, default: /asset)
The path in the Docker image where the asset is located after the build operation.
network?
Type:
string
(optional, default: no networking options)
Docker Networking options.
outputPath?
Type:
string
(optional, default: a unique temporary directory in the system temp directory)
The path on the local filesystem where the asset will be copied using docker cp.
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

.NET
Go
Java
Python
TypeScript (