I am storing my docker images in a private repository on Azure. Everytime I push an image to that repository with the same tag (e.g., latest), the previous image becomes untagged, but remains in the repository. This has led to stacking a lot of untagged images, in the repository. I would like a command, using the azure cli, to delete all the untagged images in just one go.
For instance, typing the following command:
az acr repository show-manifests -n myRegistry --repository myRepo
returned several manifests for the d24-staging-fuzzy-search-srv repository:
[
{
"digest": "sha256:blablabla1",
"tags": null,
"timestamp": "t1"
},
{
"digest": "sha256:blablabla2",
"tags": null,
"timestamp": "t2"
},
{
"digest": "sha256:blablabla3",
"tags": [
"latest"
],
"timestamp": "t3"
}]
I would like to have a command in azure cli that deletes all the mainfests that have a tag of "null" and keep the one that has the tag "latest"