BundlingDockerImage

class aws_cdk.core.BundlingDockerImage(image, _image_hash=None)

Bases: object

(deprecated) A Docker image used for asset bundling.

Deprecated

use DockerImage

Stability

deprecated

Example:

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

bundling_docker_image = cdk.BundlingDockerImage.from_asset("path",
    build_args={
        "build_args_key": "buildArgs"
    },
    file="file",
    platform="platform"
)
Parameters
  • image (str) – The Docker image.

  • _image_hash (Optional[str]) –

Stability

deprecated

Methods

cp(image_path, output_path=None)

(deprecated) Copies a file or directory out of the Docker image to the local filesystem.

If outputPath is omitted the destination path is a temporary directory.

Parameters
  • image_path (str) – the path in the Docker image.

  • output_path (Optional[str]) – the destination path for the copy operation.

Return type

str

Returns

the destination path

Stability

deprecated

run(*, command=None, entrypoint=None, environment=None, security_opt=None, user=None, volumes=None, working_directory=None)

(deprecated) Runs a Docker image.

Parameters
  • command (Optional[Sequence[str]]) – The command to run in the container. Default: - run the command defined in the image

  • entrypoint (Optional[Sequence[str]]) – The entrypoint to run in the container. Default: - run the entrypoint defined in the image

  • environment (Optional[Mapping[str, str]]) – The environment variables to pass to the container. Default: - no environment variables.

  • security_opt (Optional[str]) – Security configuration when running the docker container. Default: - no security options

  • user (Optional[str]) – The user to use when running the container. Default: - root or image default

  • volumes (Optional[Sequence[DockerVolume]]) – Docker volumes to mount. Default: - no volumes are mounted

  • working_directory (Optional[str]) – Working directory inside the container. Default: - image default

Stability

deprecated

Return type

None

to_json()

(deprecated) Provides a stable representation of this image for JSON serialization.

Return type

str

Returns

The overridden image name if set or image hash name in that order

Stability

deprecated

Attributes

image

(deprecated) The Docker image.

Stability

deprecated

Return type

str

Static Methods

classmethod from_asset(path, *, build_args=None, file=None, platform=None)

(deprecated) Reference an image that’s built directly from sources on disk.

Parameters
  • path (str) – The path to the directory containing the Docker file.

  • build_args (Optional[Mapping[str, str]]) – Build args. Default: - no build args

  • file (Optional[str]) – Name of the Dockerfile, must relative to the docker build path. Default: Dockerfile

  • platform (Optional[str]) – Set platform if server is multi-platform capable. Requires Docker Engine API v1.38+. Example value: linux/amd64 Default: - no platform specified

Deprecated

use DockerImage.fromBuild()

Stability

deprecated

Return type

BundlingDockerImage

classmethod from_registry(image)

(deprecated) Reference an image on DockerHub or another online registry.

Parameters

image (str) – the image name.

Stability

deprecated

Return type

DockerImage