Method: Docker::Image#insert
- Defined in:
- lib/docker/image.rb
#insert(query = {}) ⇒ Object
Insert a file into the Image, returns a new Image that has that file.
44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 |
# File 'lib/docker/image.rb', line 44 def insert(query = {}) ensure_created! body = self.connection.post( :path => "/images/#{self.id}/insert", :headers => { 'Content-Type' => 'text/plain', 'User-Agent' => "Docker-Client/1.2" }, :query => query, :expects => (200..204) ).body if (id = body.match(/{"Id":"([a-f0-9]+)"}\z/)).nil? || id[1].empty? raise UnexpectedResponseError, "Could not find Id in '#{body}'" else Docker::Image.new(:id => id[1], :connection => self.connection) end end |