docker rm doesn't respond and only option is to restart docker desktop

929 views Asked by At

I have docker desktop (2.4.00) installed on Mac (Catalina ). Recently, we have been seeing docker not responding in the middle of the builds. The subsequent docker requests are in "created" state, but never progresses from there. Basically all the containers are hung. The only way to recover from here is to restart docker desktop.

followed the steps in https://docs.docker.com/docker-for-mac/troubleshoot/ to collect the logs and found the below message in right about when all the containers became unresponsive.

localhost com.docker.backend[988]: volumeResource: cannot inspect container 94126dd1****** localhost com.docker.backend[988]: volumeResource: cannot inspect container 59988882******

Apparently docker says the container is running, but it was killed for some unknown reason. docker rm -f and docker kill both are not running indefinite and not killing the container. The container seems to have become a zombie and the only way to recover is by restarting docker desktop.

Can someone please guide me further on how to debug more and how to get the docker back to usable state without a need to restart docker desktop.

2

There are 2 answers

1
eniott On

You can run docker ps -a to check all the up or down containers. By then, you can try and inspect with docker container inspect (container-id here) or a docker container rm -f (container-id here) with the -f parameter to force the container removal. Another option is to do a docker container prune to remove all the stopped containers, and then you can bring them all up again.

1
dılo sürücü On

are you sure ?
for container remove but the container must be stoped

docker container rm <container-id or container name>

show all docker container list


docker container ls  -a 

show list that only working docker container

docker container ls 

if you want remove container force u can use -f parameter for example

docker container rm -f <container-id or container-name>