In Docker Desktop for Windows the WSL2 version, you don't usually have options to increase memory and diskspace as it will be managed directly by Windows.
The Docker Desktop data can be found originally in this location
In order to make this work, first shutdown Docker Desktop. This can be done by right-clicking the system tray icon of Docker then from the context menu Quit Docker Destop.
Next is open your command prompt and type the following:
On which, when run will return to you the state of all WSL images.
After that we export the
docker-desktop-data into a tar archive. We will assume you are planning to move the docker data into
D: drive, and within the drive you have already created a folder named
Next, is to unregister
docker-desktop-data from WSL.
This command below will delete
%USERPROFILE%\AppData\Local\Docker\wsl\data\ext4.vhdx, so make sure you back it up first.
After export, we do import
docker-desktop-data back to WSL.
ext4.vhdx will now reside in the
D:\Docker folder. Start Docker Desktop and verify the changes.
If everything works out, you can now delete the tar archive you created earlier
D:\docker-desktop-data.tar. Please don't delete the
ext4.vhdx, otherwise you would lose all your images and containers in docker.
In case docker icon turns red in Docker Desktop, clear the docker cache which can be found in Docker Desktop settings.