Docker annoyingly, by default, will spam your root filesystem and kill your operating system. Amazing software!
Change where docker spams its content.
- Stop docker:
sudo systemctl stop docker - Make a place for the data to go. For example:
mkdir -p ~/docker-data - Create a
daemon.jsonin/etc/docker/and tell it where thedata-rootshould be:sudo nano /etc/docker/daemon.json
{
"data-root": "/home/yourusername/docker-data"
}- Restart docker:
sudo systemctl start docker
Related: