Home > Mobile >  Docker registry storage
Docker registry storage

Time:02-19

Let's say I have a Docker private registery and a Dockerfile for an application.

When I build my image with a specific tag and push it to the registry, then re-build it with different code ( for example I copy a different JAR or I re-run npm install && ng build ) with that same tag, does the registry keep the old image, even though I don't need it anymore since I replaced it with a new one ? I am asking because I am concerned about the storage memory for the Docker registery, and maybe pushing so much layers that I don't need anymore and intented to replace will result in losing storage memory for nothing.

CodePudding user response:

Yes, it will keep it.

A tag is just an easy way to have access to an image, but what ultimately matters is the hash of the image, and that will be different.

Probably, the registry you want to use will have some maintenance task to remove older images, or you can just write a simple script yourself.

  • Related