Class: Sidedock::Image
Instance Attribute Summary collapse
-
#id ⇒ Object
Returns the value of attribute id.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(id) ⇒ Image
constructor
A new instance of Image.
- #remove ⇒ Object
- #remove_containers_using_it ⇒ Object
Methods inherited from Base
Constructor Details
#initialize(id) ⇒ Image
Returns a new instance of Image.
5 6 7 |
# File 'lib/sidedock/image.rb', line 5 def initialize(id) @id = id end |
Instance Attribute Details
#id ⇒ Object
Returns the value of attribute id.
3 4 5 |
# File 'lib/sidedock/image.rb', line 3 def id @id end |
Class Method Details
.build(dockerfile_path) ⇒ Object
18 19 20 21 |
# File 'lib/sidedock/image.rb', line 18 def self.build(dockerfile_path) built_id = machine.execute "build -q #{dockerfile_path}" new built_id end |
Instance Method Details
#remove ⇒ Object
9 10 11 12 |
# File 'lib/sidedock/image.rb', line 9 def remove remove_containers_using_it machine.execute "rmi -f #{@id}" end |
#remove_containers_using_it ⇒ Object
14 15 16 |
# File 'lib/sidedock/image.rb', line 14 def remove_containers_using_it Container.using_image(self).each(&:remove) end |