Skip to content

Instantly share code, notes, and snippets.

@LiamPerson
Created May 9, 2025 14:10
Show Gist options
  • Select an option

  • Save LiamPerson/bcdb39765e6228fc115c97b31168b5db to your computer and use it in GitHub Desktop.

Select an option

Save LiamPerson/bcdb39765e6228fc115c97b31168b5db to your computer and use it in GitHub Desktop.
How to stop Docker from spamming your root filesystem

How to stop Docker from spamming your root filesystem

Docker annoyingly, by default, will spam your root filesystem and kill your operating system. Amazing software!

Change where docker spams its content.

  1. Stop docker: sudo systemctl stop docker
  2. Make a place for the data to go. For example: mkdir -p ~/docker-data
  3. Create a daemon.json in /etc/docker/ and tell it where the data-root should be: sudo nano /etc/docker/daemon.json
{
  "data-root": "/home/yourusername/docker-data"
}
  1. Restart docker: sudo systemctl start docker

Related:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment