Browse code

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 <cpuguy83@gmail.com>

Brian Goff authored on 2015/04/28 05:10:59
Showing 1 changed files
... ...
@@ -129,6 +129,7 @@ func (daemon *Daemon) commonRm(container *Container, forceRemove bool) (err erro
129 129
 		if err != nil && forceRemove {
130 130
 			daemon.idIndex.Delete(container.ID)
131 131
 			daemon.containers.Delete(container.ID)
132
+			os.RemoveAll(container.root)
132 133
 		}
133 134
 	}()
134 135