providers/docker: more robustly detect built image [GH-4598]
This commit is contained in:
parent
945b63f033
commit
e749eaa039
|
@ -7,6 +7,8 @@ BUG FIXES:
|
||||||
- providers/docker: Nicer error if package is called. [GH-4595]
|
- providers/docker: Nicer error if package is called. [GH-4595]
|
||||||
- providers/docker: Host IP restriction is forwarded through. [GH-4505]
|
- providers/docker: Host IP restriction is forwarded through. [GH-4505]
|
||||||
- providers/docker: Protocol is now honored in direct `ports settings.
|
- providers/docker: Protocol is now honored in direct `ports settings.
|
||||||
|
- providers/docker: Images built using `build\_dir` will more robustly
|
||||||
|
capture the final image. [GH-4598]
|
||||||
- providers/virtualbox: Show a human-friendly error if VirtualBox didn't
|
- providers/virtualbox: Show a human-friendly error if VirtualBox didn't
|
||||||
clean up an existing VM. [GH-4681]
|
clean up an existing VM. [GH-4681]
|
||||||
- provisioners/docker: Search for docker binary in multiple places. [GH-4580]
|
- provisioners/docker: Search for docker binary in multiple places. [GH-4580]
|
||||||
|
|
|
@ -18,15 +18,15 @@ module VagrantPlugins
|
||||||
args = Array(opts[:extra_args])
|
args = Array(opts[:extra_args])
|
||||||
args << dir
|
args << dir
|
||||||
result = execute('docker', 'build', *args)
|
result = execute('docker', 'build', *args)
|
||||||
regexp = /Successfully built (.+)$/i
|
matches = result.scan(/Successfully built (.+)$/i)
|
||||||
match = regexp.match(result)
|
if matches.empty?
|
||||||
if !match
|
|
||||||
# This will cause a stack trace in Vagrant, but it is a bug
|
# This will cause a stack trace in Vagrant, but it is a bug
|
||||||
# if this happens anyways.
|
# if this happens anyways.
|
||||||
raise "UNKNOWN OUTPUT: #{result}"
|
raise "UNKNOWN OUTPUT: #{result}"
|
||||||
end
|
end
|
||||||
|
|
||||||
match[1]
|
# Return the last match, and the capture of it
|
||||||
|
matches[-1][0]
|
||||||
end
|
end
|
||||||
|
|
||||||
def create(params, **opts, &block)
|
def create(params, **opts, &block)
|
||||||
|
|
Loading…
Reference in New Issue