Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Lost all docker containers and images after upgrading docker

Tags:

docker

I upgraded my docker to 2.5.0.1 in windows after upgrading I lost all containers and images Is there any way to recover them? Why they lost?

like image 633
WebMaster Avatar asked Dec 05 '20 08:12

WebMaster


1 Answers

You aren't alone. This seems to be a common occurrence with Docker. A very quick search reveals the following, which may be helpful:

  • All volumes, containers and images gone after update to 1.13.0
  • All images gone after upgrade to 2.1.0
  • Docker deletes all my files on WSL2 where containers have linked volumes
  • Lost all my images and containers after upgrading to version 2.0.0.0-mac78 (28905)

This happened to me as well. I haven't used docker in several months, but I had several images locally. I went to use it today, and saw the same thing - all but one of my images in Linux, and one in Windows, are gone. I used to have nothing but good things to say about docker, but this is a cause for concern.

Update

I use Docker for Windows. I can find the original images if I modify Docker to use the legacy Hyper-V backend, rather than the WSL 2 based engine.

  • Open up Docker Desktop
  • Click on Settings
  • Uncheck "Use the WSL 2 based engine"
  • Click "Apply & Restart"

I found this setting after the OP mentioned disabling WSL completely on their system. The question now becomes how do we convert these images so that they are supported by the WSL 2 engine?

like image 68
Seth Flowers Avatar answered Sep 25 '22 07:09

Seth Flowers