mirror of
https://github.com/balena-os/balena-supervisor.git
synced 2025-01-03 04:26:44 +00:00
On cleanup, force removal for images and containers, and remove container volumes
This commit is contained in:
parent
e0b24560b7
commit
e7acff0bcf
@ -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]
|
* Add system logs for Shutdown, Reboot and Purge [Pablo]
|
||||||
|
|
||||||
# v2.3.0
|
# v2.3.0
|
||||||
|
@ -145,7 +145,7 @@ do ->
|
|||||||
return true
|
return true
|
||||||
return containerHasExited(containerInfo.Id)
|
return containerHasExited(containerInfo.Id)
|
||||||
.map (containerInfo) ->
|
.map (containerInfo) ->
|
||||||
docker.getContainer(containerInfo.Id).removeAsync()
|
docker.getContainer(containerInfo.Id).removeAsync(v: true, force: true)
|
||||||
.then ->
|
.then ->
|
||||||
console.log('Deleted container:', containerInfo.Id, containerInfo.Image)
|
console.log('Deleted container:', containerInfo.Id, containerInfo.Image)
|
||||||
.catch(_.noop)
|
.catch(_.noop)
|
||||||
@ -155,7 +155,7 @@ do ->
|
|||||||
return _.contains(appTags, tag) or _.contains(supervisorTags, tag) or _.contains(locallyCreatedTags, tag)
|
return _.contains(appTags, tag) or _.contains(supervisorTags, tag) or _.contains(locallyCreatedTags, tag)
|
||||||
Promise.map imagesToClean, (image) ->
|
Promise.map imagesToClean, (image) ->
|
||||||
Promise.map image.RepoTags.concat(image.Id), (tag) ->
|
Promise.map image.RepoTags.concat(image.Id), (tag) ->
|
||||||
docker.getImage(tag).removeAsync()
|
docker.getImage(tag).removeAsync(force: true)
|
||||||
.then ->
|
.then ->
|
||||||
console.log('Deleted image:', tag, image.Id, image.RepoTags)
|
console.log('Deleted image:', tag, image.Id, image.RepoTags)
|
||||||
.catch(_.noop)
|
.catch(_.noop)
|
||||||
|
Loading…
Reference in New Issue
Block a user