Class: Conjure::Provision::Docker::Image
- Inherits:
-
Object
- Object
- Conjure::Provision::Docker::Image
- Defined in:
- lib/conjure/provision/docker/image.rb
Instance Attribute Summary collapse
-
#image_name ⇒ Object
readonly
Returns the value of attribute image_name.
Instance Method Summary collapse
-
#initialize(docker_host, image_name) ⇒ Image
constructor
A new instance of Image.
- #start(command, options = {}) ⇒ Object
Constructor Details
#initialize(docker_host, image_name) ⇒ Image
Returns a new instance of Image.
7 8 9 10 |
# File 'lib/conjure/provision/docker/image.rb', line 7 def initialize(docker_host, image_name) @docker_host = docker_host @name = image_name end |
Instance Attribute Details
#image_name ⇒ Object (readonly)
Returns the value of attribute image_name.
5 6 7 |
# File 'lib/conjure/provision/docker/image.rb', line 5 def image_name @image_name end |
Instance Method Details
#start(command, options = {}) ⇒ Object
12 13 14 15 16 17 18 |
# File 'lib/conjure/provision/docker/image.rb', line 12 def start(command, = {}) container_id = @docker_host.started_container_id @name, command, [:run_options] sleep 2 ip_address = @docker_host.container_ip_address container_id raise "Container failed to start" unless ip_address.present? ip_address end |