DockerImageSource

class aws_cdk.cloud_assembly_schema.DockerImageSource(*, directory=None, docker_build_args=None, docker_build_target=None, docker_file=None, executable=None, network_mode=None, platform=None)

Bases: object

Properties for how to produce a Docker image from a source.

Parameters
  • directory (Optional[str]) – The directory containing the Docker image build instructions. This path is relative to the asset manifest location. Default: - Exactly one of directory and executable is required

  • docker_build_args (Optional[Mapping[str, str]]) – Additional build arguments. Only allowed when directory is set. Default: - No additional build arguments

  • docker_build_target (Optional[str]) – Target build stage in a Dockerfile with multiple build stages. Only allowed when directory is set. Default: - The last stage in the Dockerfile

  • docker_file (Optional[str]) – The name of the file with build instructions. Only allowed when directory is set. Default: “Dockerfile”

  • executable (Optional[Sequence[str]]) – A command-line executable that returns the name of a local Docker image on stdout after being run. Default: - Exactly one of directory and executable is required

  • network_mode (Optional[str]) – 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. Default: - no networking mode specified

  • platform (Optional[str]) – Platform to build for. Requires Docker Buildx. Specify this property to build images on a specific platform/architecture. Default: - current machine platform

ExampleMetadata

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
import aws_cdk.cloud_assembly_schema as cloud_assembly_schema

docker_image_source = cloud_assembly_schema.DockerImageSource(
    directory="directory",
    docker_build_args={
        "docker_build_args_key": "dockerBuildArgs"
    },
    docker_build_target="dockerBuildTarget",
    docker_file="dockerFile",
    executable=["executable"],
    network_mode="networkMode",
    platform="platform"
)

Attributes

directory

The directory containing the Docker image build instructions.

This path is relative to the asset manifest location.

Default
  • Exactly one of directory and executable is required

Return type

Optional[str]

docker_build_args

Additional build arguments.

Only allowed when directory is set.

Default
  • No additional build arguments

Return type

Optional[Mapping[str, str]]

docker_build_target

Target build stage in a Dockerfile with multiple build stages.

Only allowed when directory is set.

Default
  • The last stage in the Dockerfile

Return type

Optional[str]

docker_file

The name of the file with build instructions.

Only allowed when directory is set.

Default

“Dockerfile”

Return type

Optional[str]

executable

A command-line executable that returns the name of a local Docker image on stdout after being run.

Default
  • Exactly one of directory and executable is required

Return type

Optional[List[str]]

network_mode

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.

Default
  • no networking mode specified

Return type

Optional[str]

platform

Platform to build for. Requires Docker Buildx.

Specify this property to build images on a specific platform/architecture.

Default
  • current machine platform

Return type

Optional[str]