Work harder to reset the state of the docker env on the build worker.
This commit is contained in:
parent
de18236358
commit
40f82a9d16
1 changed files with 3 additions and 2 deletions
|
@ -125,7 +125,9 @@ class DockerfileBuildContext(object):
|
|||
(self._repo, self._tag_names))
|
||||
|
||||
def __enter__(self):
|
||||
self.__cleanup_containers()
|
||||
self.__evict_expired_images()
|
||||
self.__cleanup()
|
||||
return self
|
||||
|
||||
def __exit__(self, exc_type, value, traceback):
|
||||
|
@ -291,8 +293,6 @@ class DockerfileBuildContext(object):
|
|||
self._build_cl.remove_container(container['Id'])
|
||||
|
||||
def __evict_expired_images(self):
|
||||
self.__cleanup_containers()
|
||||
|
||||
logger.debug('Cleaning images older than %s hours.', CACHE_EXPIRATION_PERIOD_HOURS)
|
||||
now = datetime.now()
|
||||
verify_removed = set()
|
||||
|
@ -333,6 +333,7 @@ class DockerfileBuildContext(object):
|
|||
self.image_id_to_cache_time[image_id] = now
|
||||
|
||||
for tag in image['RepoTags']:
|
||||
# TODO this is slightly wrong, replace it with util/dockerfileparse.py when merged
|
||||
tag_repo = tag.split(':')[0]
|
||||
if tag_repo != '<none>':
|
||||
if self.__is_repo_public(tag_repo):
|
||||
|
|
Reference in a new issue