I've had Docker Desktop installed on my C:\
drive for a while now and it keeps hogging space on my SSD. Even if I delete all of my containers and images it still takes a lot of space, I'm guessing some cached files or something. The only way I could recover space on my SSD is to fully uninstall Docker Desktop.
I've been trying to install Docker Desktop onto a larger HDD but it's not an option on the installer. I've seen some guides about modifying the services and supplying the --data-root
flag but it doesn't seem to work. I couldn't restart the dockerd
service, etc.
start /w "" "Docker Desktop Installer.exe" install -accept-license --installation-dir=E:\path\to\folder
Note: the installer does not create the "Docker" dir this way if you don't specify a directory after the driver letter. Make sure to write E:\Docker
at minimumNote: the WSL, image etc still will be in %HOME%\AppData\Local\Docker. As noted in comments, you can change that too by adding: --wsl-default-data-root=E:\path\to\data\folder
(for Windows 11, you might also check the another answer in this thread)
Documentation: https://docs.docker.com/desktop/install/windows-install/#install-from-the-command-line