Skip to content

DockerImageAssetSource

Initializer

import ros_cdk_core
ros_cdk_core.DockerImageAssetSource(
  source_hash: str,
  asset_name: str = None,
  directory_name: str = None,
  docker_build_args: typing.Mapping[str] = None,
  docker_build_sac_rets: typing.Mapping[str] = None,
  docker_build_ssh: str = None,
  docker_build_target: str = None,
  docker_cache_disabled: bool = None,
  docker_cache_from: typing.List[DockerCacheOption] = None,
  docker_cache_to: DockerCacheOption = None,
  docker_file: str = None,
  docker_outputs: typing.List[str] = None,
  executable: typing.List[str] = None,
  network_mode: str = None,
  platform: str = None
)

Properties

Name Type Description
source_hash str The hash of the contents of the docker build context.
asset_name str Unique identifier of the docker image asset and its potential revisions.
directory_name str The directory where the Dockerfile is stored, must be relative to the cloud assembly root.
docker_build_args typing.Mapping[str] Build args to pass to the docker build command.
docker_build_sac_rets typing.Mapping[str] Build sACRets to pass to the docker build command.
docker_build_ssh str SSH agent socket or keys to pass to the docker buildx command.
docker_build_target str Docker target to build to.
docker_cache_disabled bool Disable the cache and pass --no-cache to the docker build command.
docker_cache_from typing.List[DockerCacheOption] Cache from options to pass to the docker build command.
docker_cache_to DockerCacheOption Cache to options to pass to the docker build command.
docker_file str Path to the Dockerfile (relative to the directory).
docker_outputs typing.List[str] Outputs to pass to the docker build command.
executable typing.List[str] An external command that will produce the packaged asset.
network_mode str Networking mode for the RUN commands during build. Requires Docker Engine API v1.25+.
platform str Platform to build for. Requires Docker Buildx.

source_hashRequired

source_hash: str
  • Type: 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).


asset_nameOptional

asset_name: str
  • Type: str
  • Default: no asset name

Unique identifier of the docker image asset and its potential revisions.

Required if using AppScopedStagingSynthesizer.


directory_nameOptional

directory_name: str
  • Type: str
  • Default: Exactly one of directoryName and executable is required

The directory where the Dockerfile is stored, must be relative to the cloud assembly root.


docker_build_argsOptional

docker_build_args: typing.Mapping[str]
  • Type: typing.Mapping[str]
  • Default: no build args are passed

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.

Only allowed when directoryName is specified.


docker_build_sac_retsOptional

docker_build_sac_rets: typing.Mapping[str]
  • Type: typing.Mapping[str]
  • Default: no build sACRets are passed

Build sACRets to pass to the docker build command.

Since Docker build sACRets are resolved before deployment, keys and values cannot refer to unresolved tokens.

Only allowed when directoryName is specified.


docker_build_sshOptional

docker_build_ssh: str
  • Type: str
  • Default: no ssh arg is passed

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


docker_build_targetOptional

docker_build_target: str
  • Type: str
  • Default: no target

Docker target to build to.

Only allowed when directoryName is specified.


docker_cache_disabledOptional

docker_cache_disabled: bool
  • Type: bool
  • Default: cache is used

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


docker_cache_fromOptional

docker_cache_from: typing.List[DockerCacheOption]

Cache from options to pass to the docker build command.


docker_cache_toOptional

docker_cache_to: DockerCacheOption

Cache to options to pass to the docker build command.


docker_fileOptional

docker_file: str
  • Type: str
  • Default: no file

Path to the Dockerfile (relative to the directory).

Only allowed when directoryName is specified.


docker_outputsOptional

docker_outputs: typing.List[str]
  • Type: typing.List[str]
  • Default: no build args are passed

Outputs to pass to the docker build command.


executableOptional

executable: typing.List[str]
  • Type: typing.List[str]
  • Default: Exactly one of directoryName and executable is required

An external command that will produce the packaged asset.

The command should produce the name of a local Docker image on stdout.


network_modeOptional

network_mode: str
  • Type: str
  • Default: no networking mode specified

Networking mode for the RUN commands during build. Requires Docker Engine API v1.25+.

Specify this property to build images on a specific networking mode.


platformOptional

platform: str
  • Type: str
  • Default: no platform specified (the current machine architecture will be used)

Platform to build for. Requires Docker Buildx.

Specify this property to build images on a specific platform.