Unused Docker containers stuck in Removal in Progress state. Device or Resource Busy

Viewed 4732

I'm running Docker version 20.10.5 on a Centos 7 Box. I stopped my project with docker-compose down and every container had the same message -

Error response from daemon: container <container ID>: driver "overlay2" failed to remove root filesystem: unlinkat /var/lib/docker/overlay2/<long number>/merged: device or resource busy

I've stopped the daemon, I've reinstalled Docker, I've tried umount, lsof, kill, and all the docker go-away commands including system prune but still they hang on.

(After re-installing Docker the status changes to Dead. When I try to delete the zombie containers their status changes to Removal In Progress)

How can I get rid of these containers?

1 Answers

For people who have similar issues: So I had similar issue where docker rm -f <docker name> was hanging The only thing that helped me was:

service docker restart
Related