Class: AWSCDK::DockerVolume

Inherits:
Jsii::Struct
  • Object
show all
Defined in:
docker_volume.rb

Overview

A Docker volume.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(container_path:, host_path:, consistency: nil) ⇒ DockerVolume

Returns a new instance of DockerVolume.

Parameters:

  • container_path (String)

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

  • host_path (String)

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

  • consistency (AWSCDK::DockerVolumeConsistency, nil) (defaults to: nil)

    Mount consistency.



10
11
12
13
14
15
16
17
# File 'docker_volume.rb', line 10

def initialize(container_path:, host_path:, consistency: nil)
  @container_path = container_path
  Jsii::Type.check_type(@container_path, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "containerPath")
  @host_path = host_path
  Jsii::Type.check_type(@host_path, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "hostPath")
  @consistency = consistency
  Jsii::Type.check_type(@consistency, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5Eb2NrZXJWb2x1bWVDb25zaXN0ZW5jeSJ9")), "consistency") unless @consistency.nil?
end

Instance Attribute Details

#consistencyAWSCDK::DockerVolumeConsistency? (readonly)

Note:

Default: DockerConsistency.DELEGATED

Mount consistency.

Only applicable for macOS



34
35
36
# File 'docker_volume.rb', line 34

def consistency
  @consistency
end

#container_pathString (readonly)

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

Returns:

  • (String)


22
23
24
# File 'docker_volume.rb', line 22

def container_path
  @container_path
end

#host_pathString (readonly)

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

Returns:

  • (String)


26
27
28
# File 'docker_volume.rb', line 26

def host_path
  @host_path
end

Class Method Details

.jsii_propertiesObject



36
37
38
39
40
41
42
# File 'docker_volume.rb', line 36

def self.jsii_properties
  {
    :container_path => "containerPath",
    :host_path => "hostPath",
    :consistency => "consistency",
  }
end

Instance Method Details

#to_jsiiObject



44
45
46
47
48
49
50
51
52
# File 'docker_volume.rb', line 44

def to_jsii
  result = {}
  result.merge!({
    "containerPath" => @container_path,
    "hostPath" => @host_path,
    "consistency" => @consistency,
  })
  result.compact
end