Description
What happened:
my execution “docker rmi -f imageXXX” is stuck when some other container in the same host has connected to an abnormal nfs server, and i'm very sure there's no any container using this imageXXX at time.
i notice:
moby/daemon/images/image_delete.go
Lines 369 to 382 in fade624
here, all containers will be checked if running and then if the containter being checked has the identical imageid to the deleting imgid .
Lines 239 to 244 in fade624
and there is global lock. That's the reason. i think maybe adjusting the statement like that will be better:
return c.ImageID == imgID && c.IsRunning()
What you expected to happen:
no stuck when running docker rmi .
How to reproduce it (as minimally and precisely as possible):
1.mount some containers to nfs server.
2.make nfs server unaccessible.
3.docker rmi any container.
Environment:
version:
any version
Cloud provider or hardware configuration:
OS (e.g: cat /etc/os-release): Ubuntu 16.04 LTS
Kernel (e.g. uname -a):4.4.0-21-generic #37-Ubuntu
Install tools:
Network plugin and version (if this is a network-related bug):
Others: