# DockerRunOptions

Docker run options.

- Source: [`core/lib/bundling.ts`](https://github.com/aws/aws-cdk/blob/v2.275.0/packages/aws-cdk-lib/core/lib/bundling.ts#L530)
- Type last changed: v2.88.0 · 20 Jul 2023

## Example

```ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import * as cdk from 'aws-cdk-lib';
const dockerRunOptions: cdk.DockerRunOptions = {
  command: ['command'],
  entrypoint: ['entrypoint'],
  environment: {
    environmentKey: 'environment',
  },
  network: 'network',
  platform: 'platform',
  securityOpt: 'securityOpt',
  user: 'user',
  volumes: [{
    containerPath: 'containerPath',
    hostPath: 'hostPath',

    // the properties below are optional
    consistency: cdk.DockerVolumeConsistency.CONSISTENT,
  }],
  volumesFrom: ['volumesFrom'],
  workingDirectory: 'workingDirectory',
};
```

## Properties

- `command`: string[] — The command to run in the container.

  **Default:** run the command defined in the image

- `entrypoint`: string[] — The entrypoint to run in the container.

  **Default:** run the entrypoint defined in the image

- `environment`: { [key: string]: string } — The environment variables to pass to the container.

  **Default:** no environment variables.

- `network`: string — Docker [Networking options](https://docs.docker.com/engine/reference/commandline/run/#connect-a-container-to-a-network---network).

  **Default:** no networking options

- `platform`: string — Set platform if server is multi-platform capable. _Requires Docker Engine API v1.38+_.

  **Default:** no platform specified

  Example value: `linux/amd64`

- `securityOpt`: string — [Security configuration](https://docs.docker.com/engine/reference/run/#security-configuration) when running the docker container.

  **Default:** no security options

- `user`: string — The user to use when running the container.

  **Default:** root or image default

- `volumes`: [DockerVolume](/cdk/api/v2/docs/aws-cdk-lib.DockerVolume.html)[] — Docker volumes to mount.

  **Default:** no volumes are mounted

- `volumesFrom`: string[] — Where to mount the specified volumes from.

  **Default:** no containers are specified to mount volumes from

- `workingDirectory`: string — Working directory inside the container.

  **Default:** image default
