aws-cdk-lib.DockerRunOptions

interface DockerRunOptions

LanguageType name
.NETAmazon.CDK.DockerRunOptions
Gogithub.com/aws/aws-cdk-go/awscdk/v2#DockerRunOptions
Javasoftware.amazon.awscdk.DockerRunOptions
Pythonaws_cdk.DockerRunOptions
TypeScript (source)aws-cdk-lib » DockerRunOptions

Docker run options.

Example

// 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',
  securityOpt: 'securityOpt',
  user: 'user',
  volumes: [{
    containerPath: 'containerPath',
    hostPath: 'hostPath',

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

Properties

NameTypeDescription
command?string[]The command to run in the container.
entrypoint?string[]The entrypoint to run in the container.
environment?{ [string]: string }The environment variables to pass to the container.
network?stringDocker Networking options.
securityOpt?stringSecurity configuration when running the docker container.
user?stringThe user to use when running the container.
volumes?DockerVolume[]Docker volumes to mount.
volumesFrom?string[]Where to mount the specified volumes from.
workingDirectory?stringWorking directory inside the container.

command?

Type: string[] (optional, default: run the command defined in the image)

The command to run in the container.


entrypoint?

Type: string[] (optional, default: run the entrypoint defined in the image)

The entrypoint to run in the container.


environment?

Type: { [string]: string } (optional, default: no environment variables.)

The environment variables to pass to the container.


network?

Type: string (optional, default: no networking options)

Docker Networking options.


securityOpt?

Type: string (optional, default: no security options)

Security configuration when running the docker container.


user?

Type: string (optional, default: root or image default)

The user to use when running the container.


volumes?

Type: DockerVolume[] (optional, default: no volumes are mounted)

Docker volumes to mount.


volumesFrom?

Type: string[] (optional, default: no containers are specified to mount volumes from)

Where to mount the specified volumes from.

See also: https://docs.docker.com/engine/reference/commandline/run/#mount-volumes-from-container---volumes-from


workingDirectory?

Type: string (optional, default: image default)

Working directory inside the container.