From c3c08f76bec023218b632e4c688ff9fcda11fcef Mon Sep 17 00:00:00 2001 From: Brian Goff Date: Mon, 27 Apr 2015 16:10:59 -0400 Subject: [PATCH] Fix undead containers When a container has errors on removal, it gets flagged as dead. If you `docker rm -f` a dead container the container is dereffed from the daemon and doesn't show up on `docker ps` anymore... except that the container JSON file may still be lingering around and becomes undead when you restart the daemon. Signed-off-by: Brian Goff --- daemon/delete.go | 1 + 1 file changed, 1 insertion(+) diff --git a/daemon/delete.go b/daemon/delete.go index d398741d75..464193b283 100644 --- a/daemon/delete.go +++ b/daemon/delete.go @@ -129,6 +129,7 @@ func (daemon *Daemon) commonRm(container *Container, forceRemove bool) (err erro if err != nil && forceRemove { daemon.idIndex.Delete(container.ID) daemon.containers.Delete(container.ID) + os.RemoveAll(container.root) } }()