aws-cdk-lib.DockerVolume

interface DockerVolume

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

A Docker volume.

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 dockerVolume: cdk.DockerVolume = {
  containerPath: 'containerPath',
  hostPath: 'hostPath',

  // the properties below are optional
  consistency: cdk.DockerVolumeConsistency.CONSISTENT,
};

Properties

NameTypeDescription
containerPathstringThe path where the file or directory is mounted in the container.
hostPathstringThe path to the file or directory on the host machine.
consistency?DockerVolumeConsistencyMount consistency.

containerPath

Type: string

The path where the file or directory is mounted in the container.


hostPath

Type: string

The path to the file or directory on the host machine.


consistency?

Type: DockerVolumeConsistency (optional, default: DockerConsistency.DELEGATED)

Mount consistency.

Only applicable for macOS

See also: https://docs.docker.com/storage/bind-mounts/#configure-mount-consistency-for-macos