For any project I work on these days I use Docker. At the very least I use Docker for local development but whenever possible I try to use Docker in production. I prefer using the tiny PaaS named Dokku as it is very easy to set up and use (especially compared to Kubernetes).
I have run into disk space issues with using Docker/Dokku. Sometimes Dokku doesn’t clean up old images and containers. This seems to happen only during a deployment when the build fails.
The following command takes care of that.
docker system prune --volumes
This removes all stopped containers, all unused networks, all dangling images, the build cache and with the –volumes option, all unused volumes.
I run this command occasionally on my Dokku servers and also on my local machine.
It’s amazing to see how much space docker can eat up if you are not actively monitoring it.
More information available in Docker’s official documentation.
Here’s a link to Dokku if you are interested in trying “The smallest PaaS implementation you’ve ever seen”.