Skip to content
v2.276.0

DockerVolume Struct ​

A Docker volume.

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

  // the properties below are optional
  consistency: cdk.DockerVolumeConsistency.CONSISTENT,
};
python
# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
import aws_cdk as cdk

docker_volume = cdk.DockerVolume(
    container_path="containerPath",
    host_path="hostPath",

    # the properties below are optional
    consistency=cdk.DockerVolumeConsistency.CONSISTENT
)
java
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import software.amazon.awscdk.*;

DockerVolume dockerVolume = DockerVolume.builder()
        .containerPath("containerPath")
        .hostPath("hostPath")

        // the properties below are optional
        .consistency(DockerVolumeConsistency.CONSISTENT)
        .build();
csharp
// Install: dotnet add package Amazon.CDK.Lib
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK;

var dockerVolume = new DockerVolume {
    ContainerPath = "containerPath",
    HostPath = "hostPath",

    // the properties below are optional
    Consistency = DockerVolumeConsistency.CONSISTENT
};
go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import cdk "github.com/aws/aws-cdk-go/awscdk"

dockerVolume := &DockerVolume{
	ContainerPath: jsii.String("containerPath"),
	HostPath: jsii.String("hostPath"),

	// the properties below are optional
	Consistency: cdk.DockerVolumeConsistency_CONSISTENT,
}

Properties ​

consistencyoptionalDockerVolumeConsistencyconsistencyoptionalDockerVolumeConsistencyconsistencyoptionalDockerVolumeConsistencyConsistencyoptionalDockerVolumeConsistencyConsistencyoptionalDockerVolumeConsistency= DockerConsistency.DELEGATED#
Mount consistency.

Only applicable for macOS

containerPathstringcontainer_pathstrcontainerPathStringContainerPathstringContainerPath*stringrequired#
The path where the file or directory is mounted in the container.
hostPathstringhost_pathstrhostPathStringHostPathstringHostPath*stringrequired#
The path to the file or directory on the host machine.