DockerImageAssetSource¶
-
class
aws_cdk.core.
DockerImageAssetSource
(*, source_hash, directory_name=None, docker_build_args=None, docker_build_target=None, docker_file=None, executable=None, repository_name=None)¶ Bases:
object
- Parameters
source_hash (
str
) – The hash of the contents of the docker build context. 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).directory_name (
Optional
[str
]) – The directory where the Dockerfile is stored, must be relative to the cloud assembly root. Default: - Exactly one ofdirectoryName
andexecutable
is requireddocker_build_args (
Optional
[Mapping
[str
,str
]]) – Build args to pass to thedocker build
command. Since Docker build arguments are resolved before deployment, keys and values cannot refer to unresolved tokens (such aslambda.functionArn
orqueue.queueUrl
). Only allowed whendirectoryName
is specified. Default: - no build args are passeddocker_build_target (
Optional
[str
]) – Docker target to build to. Only allowed whendirectoryName
is specified. Default: - no targetdocker_file (
Optional
[str
]) – Path to the Dockerfile (relative to the directory). Only allowed whendirectoryName
is specified. Default: - no fileexecutable (
Optional
[List
[str
]]) – An external command that will produce the packaged asset. The command should produce the name of a local Docker image onstdout
. Default: - Exactly one ofdirectoryName
andexecutable
is requiredrepository_name (
Optional
[str
]) – (deprecated) ECR repository name. Specify this property if you need to statically address the image, e.g. from a Kubernetes Pod. Note, this is only the repository name, without the registry and the tag parts. Default: - automatically derived from the asset’s ID.
Attributes
-
directory_name
¶ The directory where the Dockerfile is stored, must be relative to the cloud assembly root.
- Default
Exactly one of
directoryName
andexecutable
is required
- Return type
Optional
[str
]
-
docker_build_args
¶ Build args to pass to the
docker build
command.Since Docker build arguments are resolved before deployment, keys and values cannot refer to unresolved tokens (such as
lambda.functionArn
orqueue.queueUrl
).Only allowed when
directoryName
is specified.- Default
no build args are passed
- Return type
Optional
[Mapping
[str
,str
]]
-
docker_build_target
¶ Docker target to build to.
Only allowed when
directoryName
is specified.- Default
no target
- Return type
Optional
[str
]
-
docker_file
¶ Path to the Dockerfile (relative to the directory).
Only allowed when
directoryName
is specified.- Default
no file
- Return type
Optional
[str
]
-
executable
¶ An external command that will produce the packaged asset.
The command should produce the name of a local Docker image on
stdout
.- Default
Exactly one of
directoryName
andexecutable
is required
- Return type
Optional
[List
[str
]]
-
repository_name
¶ (deprecated) ECR repository name.
Specify this property if you need to statically address the image, e.g. from a Kubernetes Pod. Note, this is only the repository name, without the registry and the tag parts.
- Default
automatically derived from the asset’s ID.
- Deprecated
repository name should be specified at the environment-level and not at the image level
- Stability
deprecated
- Return type
Optional
[str
]
-
source_hash
¶ The hash of the contents of the docker build context.
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).
- Return type
str