From 8041d0ae78ca86f3e21b18a4f74dace5e26b85e8 Mon Sep 17 00:00:00 2001 From: Juha Ruotsalainen Date: Fri, 15 Nov 2019 13:36:30 +0200 Subject: [PATCH] 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. --- plugins/providers/docker/driver.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/providers/docker/driver.rb b/plugins/providers/docker/driver.rb index acad830cf..9a98d3a2d 100644 --- a/plugins/providers/docker/driver.rb +++ b/plugins/providers/docker/driver.rb @@ -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.