Is there a way to automatically or more efficiently remove old Azure container images?

LaBombard, Lory 41 Reputation points
2023-10-19T18:53:10.8233333+00:00

Devop teams have to manually remove container registry images to prune outdated images. We would like to find a way for them to automatically remove them. Does this exist and/or is there a more efficient way than just manually removing them?

Azure Container Registry
Azure Container Registry
An Azure service that provides a registry of Docker and Open Container Initiative images.
482 questions
{count} votes

Accepted answer
  1. shiva patpi 13,261 Reputation points Microsoft Employee
    2023-10-19T20:58:04.4833333+00:00

    @LaBombard, Lory

    You might want to take a look at the different options to delete the images from ACR by following the below document:

    https://learn.microsoft.com/en-us/azure/container-registry/container-registry-delete

    Also take a look at automatically purging:

    https://learn.microsoft.com/en-us/azure/container-registry/container-registry-delete#automatically-purge-tags-and-manifests

    https://learn.microsoft.com/en-us/azure/container-registry/container-registry-auto-purge

    All those above options should help you out in writing the script or using the purge or you can use a batch script which was mentioned in the document or finally you can make use of the Function App timed trigger to schedule the batch script !!

    Kindly go through all the commands mentioned in that document to start with & understand the difference and significance of untagging or removing or purging etc !

    Kindly let us know if you have any additional follow-up questions , happy to help out !

    Regards,

    Shiva.

    0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.