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?
2
Answers
For people who have similar issues:
So I had similar issue where
docker rm -f <docker name>
was hangingThe only thing that helped me was:
On Ubuntu
22.04
with Docker engine23.0.0
neither stopping/starting the Docker service nor adocker system prune
removed the containers (still showingRemoval in progress
). The solution as outlined here was to manually remove the volumes associated with the container(s):sudo service docker stop
sudo -i
cd /var/lib/docker/containers
rm -rf <container id>
sudo service docker start