On cleanup, force removal for images and containers, and remove container volumes

This commit is contained in:
Pablo Carranza Velez 2016-09-29 19:34:19 -03:00
parent e0b24560b7
commit e7acff0bcf
2 changed files with 3 additions and 2 deletions

View File

@ -1,3 +1,4 @@
* On cleanup, force removal for images and containers, and remove container volumes [Pablo]
* Add system logs for Shutdown, Reboot and Purge [Pablo]
# v2.3.0

View File

@ -145,7 +145,7 @@ do ->
return true
return containerHasExited(containerInfo.Id)
.map (containerInfo) ->
docker.getContainer(containerInfo.Id).removeAsync()
docker.getContainer(containerInfo.Id).removeAsync(v: true, force: true)
.then ->
console.log('Deleted container:', containerInfo.Id, containerInfo.Image)
.catch(_.noop)
@ -155,7 +155,7 @@ do ->
return _.contains(appTags, tag) or _.contains(supervisorTags, tag) or _.contains(locallyCreatedTags, tag)
Promise.map imagesToClean, (image) ->
Promise.map image.RepoTags.concat(image.Id), (tag) ->
docker.getImage(tag).removeAsync()
docker.getImage(tag).removeAsync(force: true)
.then ->
console.log('Deleted image:', tag, image.Id, image.RepoTags)
.catch(_.noop)