[Solved] Docker image disappeared after some period of time

I admit this is weird and never happen to me before and happen only with some image.

Spec

macOS: 14.5 (23F79)
Docker: 4.30.0 (149282)

All default setting: didn’t use containerd for pulling

To reproduce

  1. docker pull ghcr.io/postgresml/postgresml:2.9.1
  2. docker images
    REPOSITORY                               TAG       IMAGE ID       CREATED        SIZE
    ghcr.io/postgresml/postgresml            2.9.1     e2526947aab3   7 days ago     9.18GB
    
  3. wait for a minute, or docker run it (and it will exit then back to command line)
  4. docker images
    REPOSITORY                               TAG       IMAGE ID       CREATED        SIZE
    
  5. And it’s gone!

I try docker run and get same behavior, it will redownload and run for a minute then exit and image disappear.
I try this 4 times, I’ve to redownload image again and again.
I use Docker for many years and never hit a wall like this before :face_holding_back_tears:.

Just weird

In all cases when disappearing images were reported, it turned out there was a scheduled service running on the host, deleting images, even if they didn’t think it first. On macOS, it is weirder, because I couldn’t even tell you how scheduled tasks work on it, but that is what I would check. Docker Desktop don’t delete images automatically. So what you can check:

  • Do you have any security software, antivirus that could run periodically or detects Docker Desktop (I would be really surprised) and resets it somehow?
  • Do you have a Docker Desktop extension instaled that could delete images for more space (if their is, it doesn’t work really well…)?
  • Did you have any tool that you installed recently before you noticed this bug? Maybe there is something made for Docker Desktop but not working as an extension.

Thanks for your time. As always I got answer myself after gave up and post for help :man_shrugging:

For the record

  • It’s new mac, so no security software, antivirus.
  • No extension.
  • Not any related.
  • Same behavior for Docker 4.31.0

Solution

Change Virtual disk limit > 128GB and defaultKeepStorage > 50GB

{
  "builder": {
    "gc": {
      "defaultKeepStorage": "50GB",
      "enabled": true
    }
  },
  "experimental": false
}

It seem to work now but not sure which one did the trick and i’m too lazy to find out.
It was like disk is hit the limit without any error and downloaded image somehow get wipeout after some period of time.

Thanks! I lost all day for this! :face_holding_back_tears:

And when I wakeup, it’s gone again :face_holding_back_tears:

None of the changes should affect the images normally. The gc is for the image build cache not for existing final images.

Speculation, but if increating the storage limits seemed to help, then maybe no space left and images were kept in memory.temporarily. I don’t know if it is possible, but I have my images on my Mac, nothing disappears using Docker Desktop 4.31 and never happened with previous versions either.