Class: Microsandbox::ImageDetail

Inherits:
Object
  • Object
show all
Defined in:
lib/microsandbox/image.rb

Overview

Full inspection detail for a cached image, from Microsandbox::Image.inspect.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(data) ⇒ ImageDetail

Returns a new instance of ImageDetail.



44
45
46
47
48
# File 'lib/microsandbox/image.rb', line 44

def initialize(data)
  @handle = ImageInfo.new(data["handle"])
  @config = data["config"]
  @layers = data["layers"] || []
end

Instance Attribute Details

#configHash? (readonly)

Returns OCI config (digest, env, cmd, entrypoint, working_dir, user, labels, stop_signal). ‘labels` is a Hash (or nil) of OCI config labels.

Returns:

  • (Hash, nil)

    OCI config (digest, env, cmd, entrypoint, working_dir, user, labels, stop_signal). ‘labels` is a Hash (or nil) of OCI config labels.



40
41
42
# File 'lib/microsandbox/image.rb', line 40

def config
  @config
end

#handleImageInfo (readonly)

Returns:



37
38
39
# File 'lib/microsandbox/image.rb', line 37

def handle
  @handle
end

#layersArray<Hash> (readonly)

Returns layer descriptors.

Returns:

  • (Array<Hash>)

    layer descriptors



42
43
44
# File 'lib/microsandbox/image.rb', line 42

def layers
  @layers
end

Instance Method Details

#inspectObject



52
53
54
# File 'lib/microsandbox/image.rb', line 52

def inspect
  "#<Microsandbox::ImageDetail reference=#{@handle.reference.inspect} layers=#{@layers.size}>"
end

#referenceObject



50
# File 'lib/microsandbox/image.rb', line 50

def reference = @handle.reference