Skip to content

Instantly share code, notes, and snippets.

@Ash258
Forked from cbuckowitz/README.md
Created October 21, 2023 07:12
Show Gist options
  • Save Ash258/de5bc09a0b7d229b7c7092d66870e9c2 to your computer and use it in GitHub Desktop.
Save Ash258/de5bc09a0b7d229b7c7092d66870e9c2 to your computer and use it in GitHub Desktop.
Change Storage Location for Docker Desktop with WSL2 #DockerDesktop #WSL2

Change the Storage Location for Docker Desktop with WSL2

Docker Desktop stores docker data in 2 distros

  • docker-desktop
  • docker-desktop-data

These distros are installed on the system drive by default.

To move them to another drive, these distros can be exported, deleted and imported from the new location.

Move the docker desktop distros

Stop Docker Desktop

Shutdown all distros

wsl --shutdown

Export docker-desktop distro

wsl --export docker-desktop <export path>\docker-desktop.tar

wsl --export docker-desktop-data <export path>\docker-desktop-data.tar

Unregister docker-desktop distros

wsl --unregister docker-desktop

wsl --unregister docker-desktop-data

Import docker-desktop distros

wsl --import docker-desktop <new location, e.g another drive> <export path>\docker-desktop.tar

wsl --import docker-desktop-data <new location, e.g another drive> <export path>\docker-desktop-data.tar

Start Docker Desktop

References

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment