How can I change the location of docker images when using Docker Desktop on WSL2 with Windows 10 Home?

I’ve just upgraded to Windows 10 Home May 2020, activated WSL2, and installed Docker Desktop.

WSL2 must be installed in my system disk, which is a small SSD. I don’t want to fill it with docker images. How do I change the docker images path? I’d like to use a path in my big Windows filesystem.

The image location is somewhat confusing. I believe it is in /mnt/wsl/docker-desktop-data/.

How do I change the directory of docker images inside WSL2? May I change docker configuration to select a path inside /mnt/d, or mount a path from /mnt/d over docker data dirs?

8 Answers
8

Leave a Comment