Method: Docker::Util.extract_id

Defined in:
lib/docker/util.rb

.extract_id(body) ⇒ Object



47
48
49
50
51
52
53
54
# File 'lib/docker/util.rb', line 47

def extract_id(body)
  body.lines.to_a.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