I'm trying to figure out how to permanently change the default pull or download directory for Docker, as everything currently goes to my /var/lib/docker directory. Is it possible to modify this setting using a .json file? For reference, my setup includes a 250GB NVMe drive for the main system and a 1TB HDD for my home directory.
2 Answers
You need to edit the daemon.json file to change the default directory. Look for the `data-root` option and point it to your preferred directory. Check the Docker docs for the specifics!
You might want to keep Docker's directory on the SSD for better performance. Moving it to an HDD could slow things down quite a bit. Check out the Docker documentation for more details on this.
Using Docker on an HDD isn't the end of the world, just slower! It's good for backups or less demanding tasks.
I actually have an SSD too, but I only mount it when I want to game. It used to be my third mount point at /home/usr/Games.