RepositoryImage(image_name, *, credentials=None)¶
An image hosted in a public or private repository.
For images hosted in Amazon ECR, see EcrImage.
Constructs a new instance of the RepositoryImage class.
ISecret]) – The secret to expose to the container that contains the credentials for the image repository. The supported value is the full ARN of an AWS Secrets Manager secret.
Called when the image is used by a ContainerDefinition.
from_asset(directory, *, build_args=None, file=None, repository_name=None, target=None, extra_hash=None, exclude=None, follow=None, ignore_mode=None, follow_symlinks=None)¶
Reference an image that’s constructed directly from sources on disk.
If you already have a
DockerImageAssetinstance, you can use the
str) – The directory containing the Dockerfile.
str]]) – Build args to pass to the
docker buildcommand. Since Docker build arguments are resolved before deployment, keys and values cannot refer to unresolved tokens (such as
queue.queueUrl). Default: - no build args are passed
str]) – Path to the Dockerfile (relative to the directory). Default: ‘Dockerfile’
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: - the default ECR repository for CDK assets
str]) – Docker target to build to. Default: - no target
str]) – (deprecated) Extra information to encode into the fingerprint (e.g. build instructions and other inputs). Default: - hash is only based on source content
str]]) – (deprecated) Glob patterns to exclude from the copy. Default: nothing is excluded
FollowMode]) – (deprecated) A strategy for how to handle symlinks. Default: Never
IgnoreMode]) – (deprecated) The ignore behavior to use for exclude patterns. Default: - GLOB for file assets, DOCKER or GLOB for docker assets depending on whether the ‘
SymlinkFollowMode]) – A strategy for how to handle symlinks. Default: SymlinkFollowMode.NEVER
- Return type
Use an existing
DockerImageAssetfor this container image.
Reference an image in an ECR repository.
from_registry(name, *, credentials=None)¶
Reference an image on DockerHub or another online registry.
Use an existing tarball for this container image.
Use this method if the container image has already been created by another process (e.g. jib) and you want to add it as a container image asset.
str) – Path to the tarball (relative to the directory).
- Return type