Replace and with values appropriate for your environment. The following Azure CLI command lists all manifest digests in a repository older than a specified timestamp, in ascending order. To maintain the size of a repository or registry, you might need to periodically delete manifest digests older than a certain date. If a manifest is associated with multiple tags, all associated tags are also deleted. The acr-helloworld:v2 image is deleted from the registry, as is any layer data unique to that image. The format of the command is: az acr repository delete -name -image example, to delete the last manifest listed in the preceding output (with the tag "v2"): az acr repository delete -name myregistry -image operation will delete the manifest 'sha256:3168a21b98836dda7eb7a846b3d735286e09a32b0aa2401773da518e7eba3b57' and all the following images: 'acr-helloworld:v2'. Next, specify the digest you wish to delete in the az acr repository delete command. For example: az acr repository show-manifests -name myregistry -repository acr-helloworld To delete by digest, first list the manifest digests for the repository containing the images you wish to delete. When you delete by digest, all tags referenced by the manifest are deleted, as is layer data for any layers unique to the image. Delete by manifest digestĪ manifest digest can be associated with one, none, or multiple tags. Only the tag reference itself is deleted. No space is freed when you untag an image because its manifest and layer data remain in the registry. You can delete a tag with the Azure CLI command az acr repository untag. This operation will delete the manifest 'sha256:0a2e01852872580b2c2fea9380ff8d7b637d3928783c55beb3f21a6e58d5d108' and all the following images: 'acr-helloworld:latest', 'acr-helloworld:v3'.Īre you sure you want to continue? (y/n):ĭeleting by tag shouldn't be confused with deleting a tag (untagging). All layers unique to the image, and any other tags associated with the image are deleted.įor example, deleting the "acr-helloworld:latest" image from registry "myregistry": az acr repository delete -name myregistry -image acr-helloworld:latest To delete by tag, use az acr repository delete and specify the image name in the -image parameter. When you delete by tag, you recover the storage space used by any unique layers in the image (layers not shared by any other images in the registry). You can delete individual images from a repository by specifying the repository name and tag in the delete operation. az acr repository delete -name myregistry -repository acr-helloworld If layers referenced by the deleted manifests are not referenced by any other images in the registry, their layer data is also deleted, recovering the storage space. The following Azure CLI command deletes the "acr-helloworld" repository and all tags and manifests within the repository. When you delete a repository, you recover the storage space used by the images that reference unique layers in that repository. Delete repositoryĭeleting a repository deletes all of the images in the repository, including all tags, unique layers, and manifests.
It takes some time before the registry cleans up layers and shows the updated storage usage. However, the registry recovers the associated storage space using an asynchronous process. Delete by manifest digest: Deletes an image, all unique layers referenced by the image, and all tags associated with the image.įor an introduction to these concepts, see About registries, repositories, and images.Īfter you delete image data, Azure Container Registry stops billing you immediately for the associated storage.Delete by tag: Deletes an image, the tag, all unique layers referenced by the image, and all other tags associated with the image.Delete a repository: Deletes all images and all unique layers within the repository.This article covers several methods for deleting image data: For example, in an automated build and test scenario, your registry can quickly fill with images that might never be deployed, and can be purged shortly after completing the build and test pass.īecause you can delete image data in several different ways, it's important to understand how each delete operation affects storage usage. While some container images deployed into production may require longer-term storage, others can typically be deleted more quickly. To maintain the size of your Azure container registry, you should periodically delete stale image data.