Change Images and Containers Directory for Docker Desktop With WSL2 Backend

Quit docker-desktop

wsl --shutdown

Export Docker Desktop data

wsl --export docker-desktop-data D:\data.tar
wsl --unregister docker-desktop-data

Import the exported data to your desired location

wsl --import docker-desktop-data D:\wsl\docker-desktop-data  d:\data.tar --version 2

restart docker-desktop

λ wsl -l -v
  NAME                   STATE           VERSION
* Ubuntu2                Running         2
  docker-desktop-data    Running         2
  docker-desktop         Running         2

Related