From 719e04007552429b77ac91cc8c58828303eeea2d Mon Sep 17 00:00:00 2001 From: EFanZh Date: Tue, 30 Jul 2019 09:53:38 +0800 Subject: [PATCH] Fix #2389 Signed-off-by: EFanZh --- docker/models/images.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/docker/models/images.py b/docker/models/images.py index 54196829..346edbbb 100644 --- a/docker/models/images.py +++ b/docker/models/images.py @@ -382,13 +382,14 @@ class ImageCollection(Collection): images = [] for chunk in resp: if 'stream' in chunk: - match = re.search( - r'(^Loaded image ID: |^Loaded image: )(.+)$', - chunk['stream'] + images.extend( + match.group(2) + for match in re.finditer( + r'(^Loaded image ID: |^Loaded image: )(.+)$', + chunk['stream'], + re.M + ) ) - if match: - image_id = match.group(2) - images.append(image_id) if 'error' in chunk: raise ImageLoadError(chunk['error'])