Check stderr when building with docker cli.

Signed-off-by: Erfan Gholamian <egholamian2@gmail.com>
This commit is contained in:
Erfan Gholamian 2020-08-18 19:59:37 +04:30 committed by Ulysses Souza
parent dff3ce28f4
commit 76c92b01d4

View File

@ -1856,7 +1856,9 @@ class _CLIBuilder:
magic_word = "Successfully built "
appear = False
with subprocess.Popen(args, stdout=subprocess.PIPE, universal_newlines=True) as p:
with subprocess.Popen(args, stdout=subprocess.PIPE,
stderr=subprocess.PIPE,
universal_newlines=True) as p:
while True:
line = p.stdout.readline()
if not line:
@ -1865,6 +1867,10 @@ class _CLIBuilder:
appear = True
yield json.dumps({"stream": line})
err = p.stderr.readline().strip()
if err:
raise StreamOutputError(err)
with open(iidfile) as f:
line = f.readline()
image_id = line.split(":")[1].strip()