4

I'm completely new to docker and ddev and I have just started learning things. My main purpose to use Docker & Ddev is to work on my CMS projects. However, I noticed that by default the docker gets installed in C drive (in my case its almost full). Therefore, I want to learn how to create my projects in D drive using DDEV.

For example I would like to have them organized in one single folder like D://Myprojects\Drupalsites\Mysite1 Something like that.

How do I do that?

rfay
  • 9,963
  • 1
  • 47
  • 89
Syed Zeeshan
  • 51
  • 1
  • 2
  • 1
    Does this answer your question? [How can I change the location of docker images when using Docker Desktop on WSL2 with Windows 10 Home?](https://stackoverflow.com/questions/62441307/how-can-i-change-the-location-of-docker-images-when-using-docker-desktop-on-wsl2). You can move any WSL distribution using the same technique. – NotTheDr01ds Aug 16 '21 at 14:37

1 Answers1

2

Your problem isn't DDEV and your projects, it's docker using up your space, at at least as far as I understand your question.

So what you're really wanting to do is to move your Docker WSL2 data distro over to the new drive. As far as I know Docker and WSL2 don't provide a simple way to do this, but these two links will tell you how you can do it.

I have not tried this.

One note though: Most people these days are doing the recommended thing and running DDEV inside WSL2 (in /home/<youruser>). But if you already have trouble with disk space with WSL2, you're going to have trouble with that as well. But WSL2 should be your future, see https://ddev.readthedocs.io/en/stable/#installation-or-upgrade-windows-wsl2

rfay
  • 9,963
  • 1
  • 47
  • 89
  • Actually what you have pointed out is true but, but issue right now is I want to create new project in a new drive. I dont want my new projects to be installed in C drive but rather I want them in my D drive. – Syed Zeeshan Aug 13 '21 at 00:00
  • Do you think trying MKlink for docker folders with folders in my D drive will help me? mklink /j "C:\ProgramData\Docker" "D:\ProgramData\Docker" mklink /j "C:\ProgramData\DockerDesktop" "D:\ProgramData\DockerDesktop" mklink /j "C:\Program Files\Docker" "D:\Program Files\Docker" mklink /j "C:\Users\xxx\AppData\Local\Docker" "D:\Users\xxx\AppData\Local\Docker" – Syed Zeeshan Aug 13 '21 at 21:49
  • No, neither symlinks nor hard links will work across volumes, across disks. – rfay Aug 14 '21 at 00:17
  • There are two things you have to deal with here, projects (code + files) and docker volumes (databases). To move your *projects* is easy. You just copy them to the new place. The harder thing is moving the docker data WSL2 distro to your D: drive. – rfay Aug 14 '21 at 00:18
  • Hey Rfay, Thank you for your advise. As per the link https://dev.to/kimcuonthenet/move-docker-desktop-data-distro-out-of-system-drive-4cg2 I would have to be doing it every time I feel like docker data is increasing in my system files right? – Syed Zeeshan Aug 18 '21 at 02:04
  • I haven't done this before, but once you move your data, it should be able to grow where you moved it to. If you don't have enough space on the new drive, it's not worth playing around with. – rfay Aug 19 '21 at 12:36