Docker - Cannot remove dead container

You can also remove dead containers with this command

docker rm $(docker ps --all -q -f status=dead)

But, I'm really not sure why & how the dead containers are created. This error seems related https://github.com/typesafehub/mesos-spark-integration-tests/issues/34 whenever i get dead containers

[Update] With Docker 1.13 update, we can easily remove both unwanted containers, dangling images

$ docker system df #will show used space, similar to the unix tool df
$ docker system prune # will remove all unused data.

Most likely, an error occurred when the daemon attempted to cleanup the container, and he is now stuck in this "zombie" state.

I'm afraid your only option here is to manually clean it up:

$ sudo rm -rf /var/lib/docker/<storage_driver>/11667ef16239.../

Where <storage_driver> is the name of your driver (aufs, overlay, btrfs, or devicemapper).

Tags:

Docker