Merge pull request #25051 from dmcgowan/fix-untag-without-force-while-container-running

Fix untag without force while container running
Upstream-commit: bad654b00c954e31007c5004629e236c06ca4046
Component: engine
This commit is contained in:
Tibor Vass
2016-07-26 02:12:10 -07:00
committed by GitHub
+1 -1
View File
@@ -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