How to move Docker data in WSL2 to a different drive

Viewed 1953

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?

1 Answers

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

Related