Class: Docker::Container
- Inherits:
-
Object
- Object
- Docker::Container
- Includes:
- Model
- Defined in:
- lib/docker/container.rb
Overview
This class represents a Docker Container. It’s important to note that nothing is cached so that the information is always up to date.
Instance Attribute Summary
Attributes included from Model
Instance Method Summary collapse
-
#attach(options = {}) ⇒ Object
Attach to a container’s standard streams / logs.
-
#commit(options = {}) ⇒ Object
Create an Image from a Container’s change.s.
Methods included from Model
Instance Method Details
#attach(options = {}) ⇒ Object
Attach to a container’s standard streams / logs.
38 39 40 41 42 43 44 45 46 47 |
# File 'lib/docker/container.rb', line 38 def attach( = {}) = { :stream => true, :stdout => true }.merge() self.connection.post( :path => "/containers/#{self.id}/attach", :headers => { 'Content-Type' => 'text/plain', 'User-Agent' => "Docker-Client/0.4.6" }, :query => , :expects => (200..204) ).body end |
#commit(options = {}) ⇒ Object
Create an Image from a Container’s change.s
50 51 52 53 54 |
# File 'lib/docker/container.rb', line 50 def commit( = {}) .merge!('container' => self.id[0..7]) hash = self.connection.json_request(:post, '/commit', ) Docker::Image.send(:new, :id => hash['Id'], :connection => self.connection) end |