diff --git a/daemon/image_delete.go b/daemon/image_delete.go index 182edea536..7c61f4e016 100644 --- a/daemon/image_delete.go +++ b/daemon/image_delete.go @@ -76,7 +76,7 @@ func (daemon *Daemon) ImageDelete(imageRef string, force, prune bool) ([]types.I // first. We can only remove this reference if either force is // true, there are multiple repository references to this // image, or there are no containers using the given reference. - if !(force || len(repoRefs) > 1) { + if !force && isSingleReference(repoRefs) { if container := daemon.getContainerUsingImage(imgID); container != nil { // If we removed the repository reference then // this image would remain "dangling" and since