1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00

fix docker rmi stucking

Signed-off-by: Haichao Yang <yang.haichao@zte.com.cn>
This commit is contained in:
Haichao Yang 2019-08-19 18:28:37 +08:00
parent 0c46a20f94
commit d3f64846a2

View file

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