Skip to content

Commit

Permalink
Prune volumes
Browse files Browse the repository at this point in the history
  • Loading branch information
the-lazy-fox authored Jul 29, 2020
1 parent 90dad9e commit 4dfbaf2
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions pyouroboros/dockerclient.py
Original file line number Diff line number Diff line change
Expand Up @@ -372,6 +372,13 @@ def update(self):
self.client.images.remove(current_image.id)
except APIError as e:
self.logger.error("Could not delete old image for %s, Error: %s", container.name, e)

if self.config.cleanup_unused_volumes:
try:
self.docker.client.volumes.prune()
except APIError as e:
self.logger.error("Could not delete unused volume for %s, Error: %s", container.name, e)

updated_count += 1

self.logger.debug("Incrementing total container updated count")
Expand Down

0 comments on commit 4dfbaf2

Please sign in to comment.