DockerRunOptions

class aws_cdk.core.DockerRunOptions(*, command=None, entrypoint=None, environment=None, security_opt=None, user=None, volumes=None, working_directory=None)

Bases: object

Docker run options.

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

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

docker_run_options = cdk.DockerRunOptions(
    command=["command"],
    entrypoint=["entrypoint"],
    environment={
        "environment_key": "environment"
    },
    security_opt="securityOpt",
    user="user",
    volumes=[cdk.DockerVolume(
        container_path="containerPath",
        host_path="hostPath",

        # the properties below are optional
        consistency=cdk.DockerVolumeConsistency.CONSISTENT
    )],
    working_directory="workingDirectory"
)

Attributes

command

The command to run in the container.

Default
  • run the command defined in the image

Return type

Optional[List[str]]

entrypoint

The entrypoint to run in the container.

Default
  • run the entrypoint defined in the image

Return type

Optional[List[str]]

environment

The environment variables to pass to the container.

Default
  • no environment variables.

Return type

Optional[Mapping[str, str]]

security_opt

//docs.docker.com/engine/reference/run/#security-configuration>`_ when running the docker container.

Default
  • no security options

Type

`Security configuration <https

Return type

Optional[str]

user

The user to use when running the container.

Default
  • root or image default

Return type

Optional[str]

volumes

Docker volumes to mount.

Default
  • no volumes are mounted

Return type

Optional[List[DockerVolume]]

working_directory

Working directory inside the container.

Default
  • image default

Return type

Optional[str]