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
assetNameoptionalstringasset_nameoptionalstrassetNameoptionalStringAssetNameoptionalstringAssetNameoptional*string#Default: no asset name
Required if using AppScopedStagingSynthesizer.
directoryNameoptionalstringdirectory_nameoptionalstrdirectoryNameoptionalStringDirectoryNameoptionalstringDirectoryNameoptional*string#Default: Exactly one of directoryName and executable is required
displayNameoptionalstringdisplay_nameoptionalstrdisplayNameoptionalStringDisplayNameoptionalstringDisplayNameoptional*string#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.
dockerBuildArgsoptional{ [key: string]: string }docker_build_argsoptionaltyping.Mapping[str, str]dockerBuildArgsoptionalMap<String, String>DockerBuildArgsoptionalIDictionary<string, string>DockerBuildArgsoptional*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.
dockerBuildContextsoptional{ [key: string]: string }docker_build_contextsoptionaltyping.Mapping[str, str]dockerBuildContextsoptionalMap<String, String>DockerBuildContextsoptionalIDictionary<string, string>DockerBuildContextsoptional*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.
dockerBuildSecretsoptional{ [key: string]: string }docker_build_secretsoptionaltyping.Mapping[str, str]dockerBuildSecretsoptionalMap<String, String>DockerBuildSecretsoptionalIDictionary<string, string>DockerBuildSecretsoptional*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.
dockerBuildSshoptionalstringdocker_build_sshoptionalstrdockerBuildSshoptionalStringDockerBuildSshoptionalstringDockerBuildSshoptional*string#Default: no ssh arg is passed
dockerBuildTargetoptionalstringdocker_build_targetoptionalstrdockerBuildTargetoptionalStringDockerBuildTargetoptionalstringDockerBuildTargetoptional*string#Default: no target
Only allowed when directoryName is specified.
dockerCacheDisabledoptionalbooleandocker_cache_disabledoptionalbooldockerCacheDisabledoptionalBooleanDockerCacheDisabledoptionalboolDockerCacheDisabledoptional*bool#Default: cache is used
dockerCacheFromoptionalDockerCacheOption[]docker_cache_fromoptionaltyping.List[DockerCacheOption]dockerCacheFromoptionalList<DockerCacheOption>DockerCacheFromoptionalDockerCacheOption[]DockerCacheFromoptional*[]DockerCacheOption#Default: no cache from args are passed
dockerCacheTooptionalDockerCacheOptiondocker_cache_tooptionalDockerCacheOptiondockerCacheTooptionalDockerCacheOptionDockerCacheTooptionalDockerCacheOptionDockerCacheTooptionalDockerCacheOption#Default: no cache to args are passed
dockerFileoptionalstringdocker_fileoptionalstrdockerFileoptionalStringDockerFileoptionalstringDockerFileoptional*string#Default: no file
Only allowed when directoryName is specified.
dockerOutputsoptionalstring[]docker_outputsoptionaltyping.List[str]dockerOutputsoptionalList<String>DockerOutputsoptionalstring[]DockerOutputsoptional*[]*string#Default: no build args are passed
executableoptionalstring[]executableoptionaltyping.List[str]executableoptionalList<String>Executableoptionalstring[]Executableoptional*[]*string#Default: Exactly one of directoryName and executable is required
The command should produce the name of a local Docker image on stdout.
networkModeoptionalstringnetwork_modeoptionalstrnetworkModeoptionalStringNetworkModeoptionalstringNetworkModeoptional*string#Default: no networking mode specified
Specify this property to build images on a specific networking mode.
platformoptionalstringplatformoptionalstrplatformoptionalStringPlatformoptionalstringPlatformoptional*string#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).