Delete volume when dropping the container

Fix #567
This commit is contained in:
Julien Duponchelle committed 2016-06-13 17:39:04 +02:00
1 parent e183e7da27
commit 4f03c3011e
2 files changed
+8 -6

No files matched your search

+3 -1
View File
@@ -583,7 +583,9 @@ class DockerVM(BaseVM):
state = yield from self._get_container_state()
if state == "paused" or state == "running":
yield from self.stop()
yield from self.manager.query("DELETE", "containers/{}".format(self._cid), params={"force": 1})
# v – 1/True/true or 0/False/false, Remove the volumes associated to the container. Default false.
# force - 1/True/true or 0/False/false, Kill then remove the container. Default false.
yield from self.manager.query("DELETE", "containers/{}".format(self._cid), params={"force": 1, "v": 1})
log.info("Docker container '{name}' [{image}] removed".format(
name=self._name, image=self._image))