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[Union[DockerVolume, Dict[str, Any]]]]) – Docker volumes to mount. Default: - no volumes are mounted

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

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.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

entrypoint

The entrypoint to run in the container.

Default:
  • run the entrypoint defined in the image

environment

The environment variables to pass to the container.

Default:
  • no environment variables.

security_opt

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

Default:
  • no security options

Type:

`Security configuration <https

user

The user to use when running the container.

Default:
  • root or image default

volumes

Docker volumes to mount.

Default:
  • no volumes are mounted

working_directory

Working directory inside the container.

Default:
  • image default