I have an ACR and it contains docker images for my production and development environments. Since every day there are new images being pushed I'm trying to set a retention policy. My exact use case is as below,
According to the image, let's say I have 100 images in the ACR and the 100th image is consumed by the development environment. However, the production runs with the 40th image. That being said, I need to keep current and the last 2 images of the production environment as well as the development environment. For example, I need to keep the 38th, 39th, and 40th images as well as 98th, 99th, and 100th images.
I tried using acr purge
. Unfortunately, I cannot use either the retention policy or the acr purge for my use case (as per my understandings and maybe I'm wrong).
Can anyone help me with this scenario? Please let me know if you need further information or the requirement is vague!