Skip to content

Instantly share code, notes, and snippets.

@cbuckowitz
Last active January 21, 2024 21:17
Show Gist options
  • Star 19 You must be signed in to star a gist
  • Fork 5 You must be signed in to fork a gist
  • Save cbuckowitz/1d58d40f217dfb21f0aa54517583f8d3 to your computer and use it in GitHub Desktop.
Save cbuckowitz/1d58d40f217dfb21f0aa54517583f8d3 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

@vvsotnikov
Copy link

Thanks! Exactly what I was searching for 🙂

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