2

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.

dokgu
  • 4,957
  • 3
  • 39
  • 77
  • https://forums.docker.com/t/how-could-i-install-docker-for-windows-on-drive-e-my-ssd-c-is-full/52347 HTH Did not test it yet – cskwg Apr 18 '23 at 06:34

5 Answers5

5

I was also trying to do the same recently; install docker freshly on a different drive. In fact I am trying to keep all my installed application in a separate drive than the Windows os installation.

To install docker on, say, E:\Docker\Docker drive I did the following:

  • Don't install using double click on "Docker Desktop Installer.exe".
  • Open windows terminal as Administrator.(Right click on the Terminal icon and click on Run as administrator).
  • Goto the folder where "Docker Desktop Installer.exe" downloaded. And run start /w "" "Docker Desktop Installer.exe" install -accept-license --installation-dir=E:\Docker\Docker

One thing it will install docker to separate drive. But the WSL, image etc still will be in %HOME%\AppData\Local\Docker

Documentation: https://docs.docker.com/desktop/install/windows-install/#install-from-the-command-line

anunaki
  • 989
  • 9
  • 16
  • 1
    This answer is the correct approach. And if you want to also store images in another drive instead of the default location, you need to pass an additional flag `--wsl-default-data-root=E:\Path\to\Data\Folder`. – Jerven Clark Aug 10 '23 at 09:19
  • Notice: No trailing slashes when providing the paths to installation-dir or default-data-root argument. Also, here's the command to install and also store images to your desired drive: `start /w "" "Docker Desktop Installer.exe" install -accept-license --installation-dir=D:\Docker --wsl-default-data-root=D:\Docker\images` – Mujeeb Ishaque Aug 21 '23 at 00:34
0

After installation on a different drive on windows 10, you can face an issue with WSL. An error pops up with information related to wsl and recommends running wsl --shutdown command etc. I tried to fix the error but I couldn't.

The only solution I found was to install it again on the main C:\ drive but change the image location to a different drive.

Mujeeb Ishaque
  • 2,259
  • 24
  • 16
0

This Worked For me Using CMD(Admin) "D:\UserName\Downloads\Music\Docker Desktop Installer.exe" install -accept-license --installation-dir="E:\Program Files\Docker"enter image description here

0

I've tried many methods as suggested and it did install as expected to different drive than C when using command line. The problem was that it worked with linux containers and images but was still saving Windows images and containers in default C ProgramData although I inserted --windows-containers-default-data-root="D:\Docker" when installing.

This is what worked for me to install and save images and containers under D drive.

  • after download of "Docker Desktop Installer.exe" file

  • open the windows terminal as administrator and go to where you downloaded the file

  • run the following command

    start /w "" "Docker Desktop Installer.exe" install -accept-license --installation-dir="D:\Docker\Docker" --wsl-default-data-root="D:\Docker\wsl" --windows-containers-default-data-root="D:\Docker"

Turns out the flag --windows-containers-default-data-root="D:\\Docker" needed two backslashes instead of one.

-1

2Answer Right u must First

  1. cut the docker desktop installer to a random folder in drive e 2.create text document on that folder and paste this ----> /w "" "Docker Desktop Installer.exe" install -accept-license --installation-dir=E:\Docker\Docker
  2. Click on Save as and click on all files and write for example hello.bat 4.now run it
  • 1
    Stack Overflow is not a blog, forum or chat site. Rather, it is an encyclopaedia-like repository of information. So, please refrain from using vulgar, SMS-oriented abbreviations like "u" and "2answer", and edit your post to use proper English. – Adrian Mole Aug 25 '23 at 06:24