Build quietly and capture the image hash

At least on macOS combo Catalina + Docker engine 19.03.4 + Docker desktop 2.1.0.4 + vagrant 2.2.6 the original `matches = result.scan(/Successfully built (.+)$/i)` -line fails to generate a match. With this change I can `vagrant up --provider=docker` successfully.
This commit is contained in:
Juha Ruotsalainen 2019-11-15 13:36:30 +02:00 committed by Brian Cain
parent 237af1b6aa
commit 8041d0ae78
No known key found for this signature in database
GPG Key ID: 9FC4639B2E4510A0
1 changed files with 2 additions and 2 deletions

View File

@ -18,8 +18,8 @@ module VagrantPlugins
def build(dir, **opts, &block)
args = Array(opts[:extra_args])
args << dir
result = execute('docker', 'build', *args, &block)
matches = result.scan(/Successfully built (.+)$/i)
result = execute('docker', 'build', '-q', *args, &block)
matches = result.scan(/^sha256:([0-9a-f]+)$/i)
if matches.empty?
# This will cause a stack trace in Vagrant, but it is a bug
# if this happens anyways.