fix docker rmi stucking

Signed-off-by: Haichao Yang <yang.haichao@zte.com.cn>
(cherry picked from commit d3f64846a2)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
Haichao Yang 2019-08-19 18:28:37 +08:00 committed by Sebastiaan van Stijn
parent 879fba29d5
commit 8306f1e31e
No known key found for this signature in database
GPG key ID: 76698F39D527CE8C

View file

@ -369,7 +369,7 @@ func (i *ImageService) checkImageDeleteConflict(imgID image.ID, mask conflictTyp
if mask&conflictRunningContainer != 0 {
// Check if any running container is using the image.
running := func(c *container.Container) bool {
return c.IsRunning() && c.ImageID == imgID
return c.ImageID == imgID && c.IsRunning()
}
if container := i.containers.First(running); container != nil {
return &imageDeleteConflict{