Method: Docker::Util.extract_id

Defined in:
lib/docker/util.rb

.extract_id(body) ⇒ Object



194
195
196
197
198
199
200
201
# File 'lib/docker/util.rb', line 194

def extract_id(body)
  body.lines.reverse_each do |line|
    if (id = line.match(/Successfully built ([a-f0-9]+)/)) && !id[1].empty?
      return id[1]
    end
  end
  raise UnexpectedResponseError, "Couldn't find id: #{body}"
end