Merge pull request #13681 from tiborvass/carry-11784

Carry 11784: rmi dangling is unsafe when pulling
This commit is contained in:
David Calavera
2015-07-17 16:17:18 -07:00
8 changed files with 120 additions and 9 deletions
+3
View File
@@ -137,6 +137,9 @@ func (daemon *Daemon) imgDeleteHelper(name string, list *[]types.ImageDelete, fi
}
func (daemon *Daemon) canDeleteImage(imgID string, force bool) error {
if daemon.Graph().IsHeld(imgID) {
return fmt.Errorf("Conflict, cannot delete because %s is held by an ongoing pull or build", stringid.TruncateID(imgID))
}
for _, container := range daemon.List() {
if container.ImageID == "" {
// This technically should never happen, but if the container