Updated recreate_containers to attempt to base intermediate container's the previous container's image.

Added in additional functionality to reset any entrypoints for the intermediate container and pull/retry handling if the image does not exist.
Updated test coverage to check if an container is recreated with an entrypoint it is handled correctly.
This commit is contained in:
Cameron Maske 2014-01-18 14:11:25 +00:00
commit 62bba1684b
3 changed files with 22 additions and 11 deletions

View file

@ -3,7 +3,7 @@ from __future__ import absolute_import
class Container(object):
"""
Represents a Docker container, constructed from the output of
Represents a Docker container, constructed from the output of
GET /containers/:id:/json.
"""
def __init__(self, client, dictionary, has_been_inspected=False):
@ -38,6 +38,10 @@ class Container(object):
def id(self):
return self.dictionary['ID']
@property
def image(self):
return self.dictionary['Image']
@property
def short_id(self):
return self.id[:10]