I have an app that periodically refined and then deployed on multiple servers. Packed app in Docker. With each update the app with Jenkins completely removed the old image and going new.
So on each server you can just download an image and launch it (and not recompiled), I launched a private Docker Registry ( https://docs.docker.com/registry
) and fill it with the image after the rebuild.
But one incomprehensible moment. How to remove from that register the old image before you pour a new one?
If I just do push with the same name, the number of the used space on the server where the spinning of the registry increases with gigabytes. To clutter up the server storing some of the old layers\images I absolutely do not need. I need to just kept the actual image that I can download and deploy at any time.
In the documentation a clear answer I found. There are, of course, the registry API
), which has methods similar to the removal. I tried to call them (with a subsequent call to garbage-collect registry-container), but it is unclear what they are really doing, as when they are invoked the amount of disk space is not reduced absolutely.