diff --git a/data/model/legacy.py b/data/model/legacy.py index 12220d168..ff1a5ba59 100644 --- a/data/model/legacy.py +++ b/data/model/legacy.py @@ -1110,6 +1110,7 @@ def find_child_image(repo, parent_image, command): .switch(Image) .where(Image.ancestors % '%/' + parent_image.id + '/%', ImageStorage.command == command) + .order_by(ImageStorage.created.desc()) .get()) except Image.DoesNotExist: return None