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
Required if using AppScopedStagingSynthesizer.
directoryNamestringdirectory_namestrdirectoryNameStringDirectoryNamestringDirectoryName*string= Exactly one of `directoryName` a…#default
Default: Exactly one of directoryName and executable is required
displayNamestringdisplay_namestrdisplayNameStringDisplayNamestringDisplayName*string= The asset hash is used to displa…#If supplied, the display name will be used in locations where the asset identifier is printed, like in the CLI progress information.
default
Default: The asset hash is used to display the asset
dockerBuildArgs{ [key: string]: string }docker_build_argstyping.Mapping[str, str]dockerBuildArgsMap<String, String>DockerBuildArgsIDictionary<string, string>DockerBuildArgs*map[string]*string= 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= 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= 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= no ssh arg is passed#dockerBuildTargetstringdocker_build_targetstrdockerBuildTargetStringDockerBuildTargetstringDockerBuildTarget*string= no target#Only allowed when directoryName is specified.
dockerCacheDisabledbooleandocker_cache_disabledbooldockerCacheDisabledBooleanDockerCacheDisabledboolDockerCacheDisabled*bool= cache is used#dockerCacheFromDockerCacheOption[]docker_cache_fromtyping.List[DockerCacheOption]dockerCacheFromList<DockerCacheOption>DockerCacheFromDockerCacheOption[]DockerCacheFrom*[]DockerCacheOption= no cache from args are passed#dockerCacheToDockerCacheOptiondocker_cache_toDockerCacheOptiondockerCacheToDockerCacheOptionDockerCacheToDockerCacheOptionDockerCacheToDockerCacheOption= no cache to args are passed#Only allowed when directoryName is specified.
dockerOutputsstring[]docker_outputstyping.List[str]dockerOutputsList<String>DockerOutputsstring[]DockerOutputs*[]*string= no build args are passed#executablestring[]executabletyping.List[str]executableList<String>Executablestring[]Executable*[]*string= Exactly one of `directoryName` a…#The command should produce the name of a local Docker image on stdout.
default
Default: Exactly one of directoryName and executable is required
networkModestringnetwork_modestrnetworkModeStringNetworkModestringNetworkMode*string= no networking mode specified#Specify this property to build images on a specific networking mode.
platformstringplatformstrplatformStringPlatformstringPlatform*string= no platform specified (the curre…#Specify this property to build images on a specific platform.
default
Default: no platform specified (the current machine architecture will be used)
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).