Recently I have been working on a set of projects that use Docker extensively. I received an error message that appeared to be an out of disk space message. At first I thought it was the host machine that was out of space. On further investigation it was the docker volume that was out of space. It makes sense for containers to have limits it’s just odd to encounter them – when you shut down the containers the volumes remain until you clean them up.
Here are some useful clean up commands for Docker.
docker volume rm $(docker volume ls)
docker rm -f $(docker ps -a -q)
docker volume prune
docker rmi -f $(docker images -q)