/ troubleshooting

Docker Images Disappear after Update

Environment:
docker desktop: 3.5.1
docker engine: 20.10.7
macOS 10.14

Issus

After updating docker. I was scared that all of my images disappeared, couldn't find any of them through docker images:

$ docker images
REPOSITORY   TAG       IMAGE ID   CREATED   SIZE

But I'm sure I didn't rm them so the only thing is find it and make it work again.

Analysis

  • Check the disk image file location settings:
    d2
  • Check if the 'Docker.raw' file is in that directory,
    • Turns out it's not in that dir. Rather, it's in ~/Library/Containers/com.docker.docker/Data/Library/Containers/com.docker.docker/Data/vms/0, which is definitely a weird path
    • I guess it might be caused by some 'backup' operations during the update.
    • Move it to the supposed path.
  • But it's still not working, let's check the location settings again:
    • by changing it to another path and back again, the Docker Descktop appended a new suffix called '/DockerDesktop' to the path! Emmmm, OK, Fine. :)
    • d3
  • So the solution should be clear now: create a /DockerDesktop folder, move the .raw file into it, and we're done.

Solution

  1. Open 'Preferences -> Resources -> Disk image location' of docker desktop, change it to another path and back again, click Apply & Restart. The new suffix will become '/DockerDesktop'.
  2. Create the corresponding '/DockerDesktop' folder under '.../vms/0'
$ cd ~/Library/Containers/com.docker.docker/Data/vms/0
$ mkdir DockerDesktop
  1. Move .raw file to it.
$ mv Docker.raw DockerDesktop/

the 'Docker.raw' might be in a different dir, try '~/Library/Containers/com.docker.docker/Data/Library/Containers/com.docker.docker/Data/vms/0'

  1. Restart docker engine

Done

Docker Images Disappear after Update
Share this