DockerImageAssetSource Struct
Example
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import * as cdk from 'aws-cdk-lib';
const dockerImageAssetSource: cdk.DockerImageAssetSource = {
sourceHash: 'sourceHash',
// the properties below are optional
assetName: 'assetName',
directoryName: 'directoryName',
displayName: 'displayName',
dockerBuildArgs: {
dockerBuildArgsKey: 'dockerBuildArgs',
},
dockerBuildContexts: {
dockerBuildContextsKey: 'dockerBuildContexts',
},
dockerBuildSecrets: {
dockerBuildSecretsKey: 'dockerBuildSecrets',
},
dockerBuildSsh: 'dockerBuildSsh',
dockerBuildTarget: 'dockerBuildTarget',
dockerCacheDisabled: false,
dockerCacheFrom: [{
type: 'type',
// the properties below are optional
params: {
paramsKey: 'params',
},
}],
dockerCacheTo: {
type: 'type',
// the properties below are optional
params: {
paramsKey: 'params',
},
},
dockerFile: 'dockerFile',
dockerOutputs: ['dockerOutputs'],
executable: ['executable'],
networkMode: 'networkMode',
platform: 'platform',
};
Properties
Default: no asset name
Required if using AppScopedStagingSynthesizer.
Default: Exactly one of directoryName and executable is required
Default: The asset hash is used to display the asset
If supplied, the display name will be used in locations where the asset identifier is printed, like in the CLI progress information.
dockerBuildArgs{ [key: string]: string }docker_build_argstyping.Mapping[str, str]dockerBuildArgsMap<String, String>DockerBuildArgsIDictionary<string, string>DockerBuildArgs*map[string]*string#Default: no build args are passed
Since Docker build arguments are resolved before deployment, keys and values cannot refer to unresolved tokens (such as lambda.functionArn or queue.queueUrl).
Only allowed when directoryName is specified.
dockerBuildContexts{ [key: string]: string }docker_build_contextstyping.Mapping[str, str]dockerBuildContextsMap<String, String>DockerBuildContextsIDictionary<string, string>DockerBuildContexts*map[string]*string#Default: no additional build contexts
notes
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).
Only allowed when directoryName is specified.
dockerBuildSecrets{ [key: string]: string }docker_build_secretstyping.Mapping[str, str]dockerBuildSecretsMap<String, String>DockerBuildSecretsIDictionary<string, string>DockerBuildSecrets*map[string]*string#Default: no build secrets are passed
Since Docker build secrets are resolved before deployment, keys and values cannot refer to unresolved tokens (such as lambda.functionArn or queue.queueUrl).
Only allowed when directoryName is specified.
dockerBuildSshstringdocker_build_sshstrdockerBuildSshStringDockerBuildSshstringDockerBuildSsh*string#Default: no ssh arg is passed
dockerBuildTargetstringdocker_build_targetstrdockerBuildTargetStringDockerBuildTargetstringDockerBuildTarget*string#Default: no target
Only allowed when directoryName is specified.
dockerCacheDisabledbooleandocker_cache_disabledbooldockerCacheDisabledBooleanDockerCacheDisabledboolDockerCacheDisabled*bool#Default: cache is used
dockerCacheFromDockerCacheOption[]docker_cache_fromtyping.List[DockerCacheOption]dockerCacheFromList<DockerCacheOption>DockerCacheFromDockerCacheOption[]DockerCacheFrom*[]DockerCacheOption#Default: no cache from args are passed
dockerCacheToDockerCacheOptiondocker_cache_toDockerCacheOptiondockerCacheToDockerCacheOptionDockerCacheToDockerCacheOptionDockerCacheToDockerCacheOption#Default: no cache to args are passed
Default: no file
Only allowed when directoryName is specified.
dockerOutputsstring[]docker_outputstyping.List[str]dockerOutputsList<String>DockerOutputsstring[]DockerOutputs*[]*string#Default: no build args are passed
executablestring[]executabletyping.List[str]executableList<String>Executablestring[]Executable*[]*string#Default: Exactly one of directoryName and executable is required
The command should produce the name of a local Docker image on stdout.
Default: no networking mode specified
Specify this property to build images on a specific networking mode.
Default: no platform specified (the current machine architecture will be used)
Specify this property to build images on a specific platform.
notes
This hash is used throughout the system to identify this image and avoid duplicate work in case the source did not change.
NOTE: this means that if you wish to update your docker image, you must make a modification to the source (e.g. add some metadata to your Dockerfile).