You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/container-registry/container-registry-delete.md
+48-49Lines changed: 48 additions & 49 deletions
Original file line number
Diff line number
Diff line change
@@ -38,13 +38,13 @@ acr-helloworld/prod:v2
38
38
39
39
## Components of an image
40
40
41
-
A container image includes several components, such as an image manifest, tags, and layers. Understanding how these components relate to each other can help you determine the best method for freeing space in your registry.
41
+
A container image within a registry is associated with one or more tags, has one or more layers, and is identified by a manifest. Understanding how these components relate to each other can help you determine the best method for freeing space in your registry.
42
42
43
43
### Tag
44
44
45
-
An image's *tag*typically specifies its version. A single image within a repository can be assigned one or many tags, and may also be "untagged." That is, you can delete all tags from an image, while the image's data (its layers) remain the registry.
45
+
An image's *tag* specifies its version. A single image within a repository can be assigned one or many tags, and may also be "untagged." That is, you can delete all tags from an image, while the image's data (its layers) remain the registry.
46
46
47
-
The repository (or repository and namespace) plus a tag defines an image's name. In the case of a private registry like Azure Container Registry, the image name also includes the fully qualified name of the registry host. The registry host for images in ACR is in the format *acrname.azurecr.io*. For example, the full name of the image in the 'test' namespace in the earlier section would be:
47
+
The repository (or repository and namespace) plus a tag defines an image's name. In the case of a private registry like Azure Container Registry, the image name also includes the fully qualified name of the registry host. The registry host for images in ACR is in the format *acrname.azurecr.io*. For example, the full name of the image in the 'test' namespace in the previous section would be:
48
48
49
49
```
50
50
myregistry.azurecr.io/acr-helloworld/test:v3
@@ -58,40 +58,49 @@ Images are made up of one or more *layers*, each corresponding to a line in the
58
58
59
59
### Manifest
60
60
61
-
Each container image includes a *manifest* that provides the identification for the image, and specifies the layers that make up the image. This example manifest defines an image with three layers:
Each container image pushed to a container registry is associated with a *manifest*. The manifest, generated by the registry when the image is pushed, uniquely identifies the image and specifies its layers. You can list the manifests for a repository with the Azure CLI command [az acr repository show-manifests][az-acr-repository-show-manifests]:
62
+
63
+
```azurecli
64
+
az acr repository show-manifests --name <acrName> --repository <repositoryName>
65
+
```
66
+
67
+
For example, listing the manifest digests for the "acr-helloworld" repository:
68
+
69
+
```console
70
+
$ az acr repository show-manifests --name myregistry --repository acr-helloworld
The manifest discussed here is different from the image manifest you can view in the Azure portal or with [docker manifest inspect][docker-manifest-inspect]. In the following section, "manifest digest" refers to the digest generated by the push operation, not the *config.digest* in the image manifest. You can pull and delete images by **manifest digest**, not config.digest. The following image illustrates the two types of digests.
98
+
99
+
![Manifest digest and config.digest in the Azure portal][manifest-digest]
100
+
92
101
### Manifest digest
93
102
94
-
Manifests are identified by a unique SHA-256 hash, or *digest* (the `"digest"` value in the `"config"` section of the preceding example manifest). A unique digest is included in each container image you build. The digest value is unique even if the image's layer data is identical to that of another image. This mechanism is what allows you to repeatedly push identically tagged images to a registry. For example, you can repeatedly push `myimage:latest` to your registry without error (though not recommended) because each image is identified by its unique digest.
103
+
Manifests are identified by a unique SHA-256 hash, or *manifest digest*. Each image--whether tagged or not--is identified by its digest. The digest value is unique even if the image's layer data is identical to that of another image. This mechanism is what allows you to repeatedly push identically tagged images to a registry. For example, you can repeatedly push `myimage:latest` to your registry without error because each image is identified by its unique digest.
95
104
96
105
You can pull an image from a registry by specifying its digest in the pull operation. Some systems may be configured to pull by digest because it guarantees the image version being pulled, even if an identically tagged image is subsequently pushed to the registry.
> If you repeatedly push modified images with identical tags, you create orphaned images--images that are untagged, but still consume space in your registry. Untagged images are not shown in the Azure CLI or in the Azure portal when you list or view images by tag. However, their layers still exist and consume space in your registry. The [Delete untagged images](#delete-untagged-images) section of this article discusses freeing space used by untagged images.
114
+
> If you repeatedly push modified images with identical tags, you might create orphaned images--images that are untagged, but still consume space in your registry. Untagged images are not shown in the Azure CLI or in the Azure portal when you list or view images by tag. However, their layers still exist and consume space in your registry. The [Delete untagged images](#delete-untagged-images) section of this article discusses freeing space used by untagged images.
106
115
107
116
## Delete image data
108
117
@@ -139,13 +148,7 @@ Are you sure you want to continue? (y/n): y
139
148
140
149
A [manifest digest](#manifest-digest) can be associated with one, none, or multiple tags. When you delete by digest, all tags referenced by the manifest are deleted, as is layer data for any layers unique to the image. Shared layer data is not deleted.
141
150
142
-
To delete by digest, first list the manifest digests for the repository containing the images you wish to delete:
143
-
144
-
```azurecli
145
-
az acr repository show-manifests --name myregistry --repository myrepository
146
-
```
147
-
148
-
For example, listing the manifest digests for the "acr-helloworld" repository:
151
+
To delete by digest, first list the manifest digests for the repository containing the images you wish to delete. For example:
149
152
150
153
```console
151
154
$ az acr repository show-manifests --name myregistry --repository acr-helloworld
@@ -309,10 +305,13 @@ Foreach($x in (az acr repository show-manifests -n $registry --repository $repos
309
305
For more information about image storage in Azure Container Registry see [Container image storage in Azure Container Registry](container-registry-storage.md).
0 commit comments