Description:
I’m experiencing an issue with Docker engine under WSL2 where all containers and images vanish after restarting WSL. Here are the details:
Environment:
WSL2 Configuration:
NAME STATE VERSION
* Ubuntu-22.04 Running 2
WSL version:2.4.11.0
Kernal version:5.15.167.4-1
WSLg version:1.0.65
Windows version:10.0.22631.4890
Affected Docker Versions: 28.0.0 and 27.5.1 (other versions untested but possibly affected)
Observed Behavior:
- After restarting WSL2:
docker images
shows no imagesdocker ps -a
shows no containers
- Temporary workaround:
Reinstalling viasudo apt reinstall docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
restores the containers/images,
but the issue reoccurs after subsequent WSL restarts.
Reproduction Steps:
- Start/Restart WSL2
- Run
docker images
anddocker ps -a
- Observe missing containers/images
Question:
Are there recommended configurations or fixes to ensure persistent storage across WSL restarts?