Class: Serverspec::Type::DockerContainer

Inherits:
DockerBase show all
Defined in:
lib/serverspec/type/docker_container.rb

Instance Attribute Summary

Attributes inherited from Base

#name

Instance Method Summary collapse

Methods inherited from DockerBase

#[], #exist?, #inspection

Methods inherited from Base

#initialize, #inspect, #to_ary, #to_s

Constructor Details

This class inherits a constructor from Serverspec::Type::Base

Instance Method Details

#has_volume?(container_path, host_path) ⇒ Boolean

Returns:

  • (Boolean)


7
8
9
10
11
12
13
# File 'lib/serverspec/type/docker_container.rb', line 7

def has_volume?(container_path, host_path)
  if (inspection['Mounts'])
    check_volume(container_path, host_path)
  else
    check_volume_pre_1_8(container_path, host_path)
  end
end

#running?Boolean

Returns:

  • (Boolean)


3
4
5
# File 'lib/serverspec/type/docker_container.rb', line 3

def running?
  inspection['State']['Running'] && !inspection['State']['Restarting']
end