Method: Docker::Container#commit
- Defined in:
- lib/docker/container.rb
#commit(options = {}) ⇒ Object
Create an Image from a Container’s change.s
129 130 131 132 133 134 135 136 137 138 139 140 |
# File 'lib/docker/container.rb', line 129 def commit( = {}) .merge!('container' => self.id[0..7]) # [code](https://github.com/dotcloud/docker/blob/v0.6.3/commands.go#L1115) # Based on the link, the config passed as run, needs to be passed as the # body of the post so capture it, remove from the options, and pass it via # the post body config = .delete('run') hash = Docker::Util.parse_json(connection.post('/commit', , :body => config.to_json)) Docker::Image.send(:new, self.connection, hash) end |