not able to remove docker

Docker Can’t Remove ‘/var/lib/docker/containers’: Device Or Resource Busy

Docker Can’t Remove /var/lib/docker and resource busy, you will also get a docker error response from the daemon and cannot connect to the container. If you’re facing this issue of docker it won’t let you as it’s already mounted. Run the following commands to troubleshoot about docker.

Once you remove this container from that location only you will be able to run or crate any docker container in the Linux. This is because docker is busy or resources being utilized somewhere. you just have to remove them and start creating containers and deploy them.

Check Out: Create Apache Image Using Dockerfile

rm -rf /var/lib/docker/

Docker Can't Remove

Locate the process

lsof +D /var/lib/docker/

docker cannot connect

if you found something here so look into it but I didn’t find anything here

Check Out: Increase CPU In a Docker Container

Check process is running using ps -ef

ps -ef | grep docker

docker resource busy

There is no docker process is running.

Finally, check where it’s mounted

mount | grep docker

cannot remove /var/lib/docker

Check Out: Monitor Health of a Container

Unmounted this  Docker Container

umount /var/lib/docker/containers

unmount docker container

Then try 

Check Out: Signup For Docker Hub

rm -rf /var/lib/docker/

docker remove

You’re done docker cannot connect error response from daemon

Leave a Reply

avatar
  Subscribe  
Notify of