Error: missing images after restarting Docker

Expected behavior

Run Docker for Windows, pull an image from the repository (for example, alpine), stop Docker and restart it.

All the downloaded images (or in this case the downloaded one) should show again when running the command “docker images”.

Actual behavior

Run Docker for Windows, pull an image from the repository (for example, alpine), stop Docker and restart it.

When I run the “docker images” command there is not any image.

And when I try to pull that image again I get the following error:

$ docker pull alpine
Using default tag: latest
latest: Pulling from library/alpine

420890c9e918: Extracting [==================================================>]  2.32 MB/2.32 MBB
failed to register layer: rename /var/lib/docker/image/aufs/layerdb/tmp/layer-163246233 /var/lib/docker/image/aufs/layerdb/sha256/c56b7dabbc7aa730eeab07668bdcbd7e3d40855047ca9a0cc1bfed23a2486111: directory not empty

Steps to reproduce the behavior

  1. Start Docker for Windows.
  2. Download an image from Docker repository.
  3. Exit Docker (stop Hyper-V virtual machine).
  4. Start Docker (start Hyper-V virtual machine).
  5. “docker images” does not show the last one or more downloaded images.
  6. Y try to download the missing image with “docker pull”. I get an error complaining about an already existing directory.

The problem is the images should not disappear from the image list if they are already stored in the virtual machine filesystem.

The more strange thing is this happens to my on my desktop PC but not on my Surface Pro 4. I have already tried several times to reset to factory default. I have the build 2446 on both systems.

1 Like

Hi

I can’t reproduce this. I have some images, I then exit the application using the menu on the whale icon in the systray and restart the application via the desktop icon. After this, the images are still there.

The images are stored in a virtual hard disk on your computer and unless you remove them they should persist across restarts

rolf

I know it’s strange, but it happens to me. And I neither delete the virtual disk nor the virtual machine before closing Docker (and there are no checkpoints for the VM created), so it’s very strange.

Everything said, the fact I close Docker approximately 2-5 seconds after downloading the image (instead, let’s say, waiting 30 seconds or 1 minute) could affect the result. I have an Samsung EVO SSD, so I don’t think is caused by slow I/O on the disk. Could be for example caused by a delayed operation which is supposed to be made inside the Alpine Linux distribution?

But it should not happen in any way, even if I close Docker a few seconds after the operation is done, specially because, surprisingly, the temporary folder is already there in the virtual disk.

The solution I have found is to create a checkpoint in the Hyper-V Virtual Machine Manager inmediatly before exiting. But it should not be necessary.

If anybody experiences the same problem any comment is welcome.

1 Like

My windows also has the same issue

This issue is almost a year old, can you provide more details on what image you’re pulling and how it appears to dissapear?

Just encountered the same. Pulled a large 10G image from my own repository yesterday, started it. The process was taking too long so shut the laptop and got on with my travels with a shutdown of Windows. I restarted Docker next day, no images available.

I have just tested with Alpine and a Docker restart via the Docker menu, but that did not cause any problems. At east in my case the issue appears to be related to shutdown.

I have also seen this issue where the image just disappears from Docker Desktop. For me, the image had been working for some time and then disappeared without a trace.
This was the docker image I had been using:
https://hub.docker.com/r/henrywhitaker3/speedtest-tracker

I have the same issue. When I refresh the images I get “Unable to calculate image disk size”.

(There is also an annoying issue where after a Windows standby, docker isn’t available in my WSL anymore, which I don’t know if it’s related but it feels like it)