ansible-container icon indicating copy to clipboard operation
ansible-container copied to clipboard

Docker ImageCollection.build() api has changed. It now returns a tuple

Open dnene opened this issue 6 years ago • 2 comments

https://github.com/ansible/ansible-container/blob/2fa778a7c8d1699672314ac0b89c53554f435cb7/container/docker/engine.py#L1151

As per the commit https://github.com/docker/docker-py/commit/631cc3c1215441edb075a999a77061c1275c5e5a (4 months ago) the return value of build() now returns a tuple with the first item being the image. Hence

                image = self.client.images.build(fileobj=tarball_file,
                                                 custom_context=True,
                                                 tag=tag,
                                                 rm=True,
                                                 nocache=not cache)

Instead needs to be

                image,_ = self.client.images.build(fileobj=tarball_file,
                                                 custom_context=True,
                                                 tag=tag,
                                                 rm=True,
                                                 nocache=not cache)

? Also do the dependencies need to be updated to ensure the correct version of docker-py gets installed with ansible container

dnene avatar Jun 05 '18 12:06 dnene

@dnene see https://github.com/ansible/ansible-container/issues/937 as they are related.

zskulcsar avatar Jun 05 '18 12:06 zskulcsar

Yes, I did indeed notice that when surprisingly the code worked in debug mode .. so I had to hunt down the issue by stepping into the code :smiley:

dnene avatar Jun 05 '18 14:06 dnene