- Quite docker desktop
- Open command prompt/powershell
- List packages (& take note of the name you wanna move, i.e. docker-desktop-data)
wsl --list -v
- Turn off wsl
wsl --shutdown
- Create destination path (preferred to not have any spaces in path)
mkdir path\to\your\new\location
- Move the data into new location as tar (we moving the package: docker-desktop-data)
wsl --export docker-desktop-data "path\to\your\new\location\docker-desktop-data.tar"
- Unregister the container data from WSL
wsl --unregister docker-desktop-data
- Import the data
wsl --import docker-desktop-data "path\to\your\new\location" "path\to\your\new\location\docker-desktop-data.tar" --version 2
- Delete the tar file
- Start the docker dektop
In future to install in preferred location
"Docker Desktop Installer.exe" install -accept-license --installation-dir=<path>\Docker\Docker --wsl-default-data-root=<path>\Docker\Images
- Stop the docker service (if you are not able to stop the service check this StackOverflow Topic)
sudo systemctl stop docker
sudo systemctl stop docker.socket
- Copy the original application tree (with all folder permissions and contents)
sudo rsync -aqxP /var/lib/docker/ /path/to/your/new/location/docker
- Edit the docker.service file
sudo vi /lib/systemd/system/docker.service
- Change the line starting the docker daemon to look for binary inside /path/to/your/new/location/
ExecStart=/usr/bin/dockerd -g /path/to/your/new/location/docker -H fd://
- Reload the updated service and restart Docker
sudo systemctl daemon-reload
sudo systemctl start docker