A.A
A.A

Reputation: 4101

Lost all docker containers and images after upgrading 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?

Upvotes: 26

Views: 22715

Answers (5)

DyedPurple
DyedPurple

Reputation: 138

I found that all my images disappeared when I turned on the option "Use containerd for pulling and storing images" (Settings -> General). When I turned off this option, my old images returned.

Upvotes: 5

user2239318
user2239318

Reputation: 2784

/lib/systemd/system/docker.service

This row will be overwritten:

ExecStart=/usr/bin/dockerd -H fd:// --containerd=/run/containerd/containerd.sock --data-root /THISISGONE

Upvotes: 1

d.popov
d.popov

Reputation: 4255

It could be that the docker root folder is changed. I had that issue

Upvotes: 0

Seth Flowers
Seth Flowers

Reputation: 9180

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

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?

Upvotes: 28

matiferrigno
matiferrigno

Reputation: 950

What kind of containers are you running on Windows (Linux Containers / Windows Containers )?

Maybe you unintentionally switch that setting and now is showing the other ones.

https://docs.docker.com/docker-for-windows/#settings check that on the tray icon.

Upvotes: 3

Related Questions