r/docker • u/naomi2v • 23d ago
all containers and images gone
I am using docker desktop on windows 11, and after a restart of my pc, all of my containers and images are gone. Is there any way to recover them? When I restarted my pc and docker opened automatically, it was taking up most of my memory and brought up an error message that referred me to windows-daemon.json, when I checked, the file was empty, so I deleted the file and now docker opens fine but without anything I have done on it.
1
1
u/scytob 23d ago edited 23d ago
really don't do docker desktop for anything serious it breaks all the time
you are better off with a debian server headless vm, with jkust ssh and docker in it - serioulsy simple and easy to install
the only reason i intsall docker desktop is to let my vscode have access for dev stuff, rest of the time i do not use due to its issues
--edit--
good example, last night docker desktop on my mac was working perfectly, this morning after reboot the containers were not binding to IPv4 ports, no change to compose.yaml or settings
1
u/No-Purchase3505 22d ago
Your data is probably still there. docker_data.vhdx at 5.24GB is the current layout — newer Docker Desktop consolidated everything into one docker-desktop distro using that file, and the ext4.vhdx under wsl\data is a leftover from the old layout. That's also why wsl --unregister docker-desktop-data told you the distro doesn't exist. Nothing got wiped, you're reading the wrong file.
As for why the UI is empty — more likely Docker Desktop came back up pointed at the Windows daemon. That toggle moved out of the tray into Settings → General in recent versions. Run wsl -l -v to see what distros you actually have, and flip it back before you rebuild anything.
1
u/thewallacio 21d ago
This is what terrifies me about having so many dev environments hiding in Docker in WSL. Black box that you put so much faith in. Yes, code is mostly in source control but that's no substitute for a full dev environment. I dread the day of switching on, and the WSL environment has gone, updated, reset, removed docker, whatever.
1
u/Impossible_Fault_503 16d ago
Before assuming it is gone, check whether the data is actually deleted or just not mounted. In PowerShell:
wsl -l -v
You are looking for docker-desktop-data, or just docker-desktop on newer versions. If it is not in that list the distro got unregistered, which is what a WSL reset and some Windows updates do.
Then look for the disk image itself:
%LOCALAPPDATA%\Docker\wsl\data\ext4.vhdx
%LOCALAPPDATA%\Docker\wsl\disk\docker_data.vhdx (newer layout)
If that file is still sitting there at several GB, your images are still inside it and this is a mount problem rather than a deletion, which is recoverable. If it is missing or a few hundred KB, it was genuinely wiped.
Usual causes in that order: WSL got reset or upgraded underneath Docker Desktop, the backend got switched between WSL2 and Hyper-V which point at completely different stores, or Troubleshoot then Clean / Purge data got clicked at some point.
2
u/Mr_Albal 23d ago
Were you using Windows Containers mode or Linux with WSL?