ContainerImageAssetMetadataEntry

class aws_cdk.cloud_assembly_schema.ContainerImageAssetMetadataEntry(*, id, packaging, path, source_hash, build_args=None, build_secrets=None, build_ssh=None, cache_disabled=None, cache_from=None, cache_to=None, file=None, image_name_parameter=None, image_tag=None, network_mode=None, outputs=None, platform=None, repository_name=None, target=None)

Bases: object

Metadata Entry spec for container images.

Parameters:
  • id (str) – Logical identifier for the asset.

  • packaging (str) – Type of asset.

  • path (str) – Path on disk to the asset.

  • source_hash (str) – The hash of the asset source.

  • build_args (Optional[Mapping[str, str]]) – Build args to pass to the docker build command. Default: no build args are passed

  • build_secrets (Optional[Mapping[str, str]]) – Build secrets to pass to the docker build command. Default: no build secrets are passed

  • build_ssh (Optional[str]) – SSH agent socket or keys to pass to the docker build command. Default: no ssh arg is passed

  • cache_disabled (Optional[bool]) – Disable the cache and pass --no-cache to the docker build command. Default: - cache is used

  • cache_from (Optional[Sequence[Union[ContainerImageAssetCacheOption, Dict[str, Any]]]]) – Cache from options to pass to the docker build command. Default: - no cache from options are passed to the build command

  • cache_to (Union[ContainerImageAssetCacheOption, Dict[str, Any], None]) – Cache to options to pass to the docker build command. Default: - no cache to options are passed to the build command

  • file (Optional[str]) – Path to the Dockerfile (relative to the directory). Default: - no file is passed

  • image_name_parameter (Optional[str]) – (deprecated) ECR Repository name and repo digest (separated by “@sha256:”) where this image is stored. Default: undefined If not specified, repositoryName and imageTag are required because otherwise how will the stack know where to find the asset, ha?

  • image_tag (Optional[str]) – The docker image tag to use for tagging pushed images. This field is required if imageParameterName is ommited (otherwise, the app won’t be able to find the image). Default: - this parameter is REQUIRED after 1.21.0

  • network_mode (Optional[str]) – Networking mode for the RUN commands during build. Default: - no networking mode specified

  • outputs (Optional[Sequence[str]]) – Outputs to pass to the docker build command. Default: - no outputs are passed to the build command (default outputs are used)

  • platform (Optional[str]) – Platform to build for. Requires Docker Buildx. Default: - current machine platform

  • repository_name (Optional[str]) – ECR repository name, if omitted a default name based on the asset’s ID is used instead. 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: - this parameter is REQUIRED after 1.21.0

  • target (Optional[str]) – Docker target to build to. Default: no build target

Example:

const entry = {
  packaging: 'container-image',
  repositoryName: 'repository-name',
  imageTag: 'tag',
}

Attributes

build_args

Build args to pass to the docker build command.

Default:

no build args are passed

build_secrets

Build secrets to pass to the docker build command.

Default:

no build secrets are passed

build_ssh

SSH agent socket or keys to pass to the docker build command.

Default:

no ssh arg is passed

cache_disabled

Disable the cache and pass --no-cache to the docker build command.

Default:
  • cache is used

cache_from

Cache from options to pass to the docker build command.

Default:
  • no cache from options are passed to the build command

See:

https://docs.docker.com/build/cache/backends/

cache_to

Cache to options to pass to the docker build command.

Default:
  • no cache to options are passed to the build command

See:

https://docs.docker.com/build/cache/backends/

file

Path to the Dockerfile (relative to the directory).

Default:
  • no file is passed

id

Logical identifier for the asset.

image_name_parameter

“) where this image is stored.

Default:

undefined If not specified, repositoryName and imageTag are required because otherwise how will the stack know where to find the asset, ha?

Deprecated:

specify repositoryName and imageTag instead, and then you know where the image will go.

Stability:

deprecated

Type:

(deprecated) ECR Repository name and repo digest (separated by “@sha256

image_tag

The docker image tag to use for tagging pushed images.

This field is required if imageParameterName is ommited (otherwise, the app won’t be able to find the image).

Default:
  • this parameter is REQUIRED after 1.21.0

network_mode

Networking mode for the RUN commands during build.

Default:
  • no networking mode specified

outputs

Outputs to pass to the docker build command.

Default:
  • no outputs are passed to the build command (default outputs are used)

See:

https://docs.docker.com/engine/reference/commandline/build/#custom-build-outputs

packaging

Type of asset.

path

Path on disk to the asset.

platform

Platform to build for.

Requires Docker Buildx.

Default:
  • current machine platform

repository_name

ECR repository name, if omitted a default name based on the asset’s ID is used instead.

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:
  • this parameter is REQUIRED after 1.21.0

source_hash

The hash of the asset source.

target

Docker target to build to.

Default:

no build target