[ACR] Design discussion for az acr repository command group
See original GitHub issueDescription
az acr repository
contains a few commands to delete a repository from a container registry or delete a manifest/tag from a repository in a container registry. Due to the complex dependency nature among docker manifest/tag/layer, using this command group becomes quite confusing and complicated.
Current implementation:
Command
az acr repository delete: Deletes a repository or a manifest/tag from the given repository in
the specified container registry.
Arguments
--name -n [Required]: The name of the container registry. You can configure the default
registry name using `az configure --defaults acr=<registry name>`.
--repository [Required]: The name of repository to delete.
--manifest : The sha256 based digest of manifest to delete.
--password -p : The password used to log into a container registry.
--resource-group -g : Name of resource group. You can configure the default group using `az
configure --defaults group=<name>`.
--tag : The name of tag to delete.
--username -u : The username used to log into a container registry.
--yes -y : Do not prompt for confirmation.
Examples
Delete a repository from the specified container registry.
az acr repository delete -n MyRegistry --repository MyRepository
Delete a tag from the given repository. This operation does not delete the manifest referenced
by the tag or associated layer data.
az acr repository delete -n MyRegistry --repository MyRepository --tag MyTag
Delete the manifest referenced by a tag. This operation also deletes associated layer data and
all other tags referencing the manifest.
az acr repository delete -n MyRegistry --repository MyRepository --tag MyTag --manifest
Delete a manfiest from the given repository. This operation also deletes associated layer data
and all tags referencing the manifest.
az acr repository delete -n MyRegistry --repository MyRepository --manifest MyManifest
Proposed implementation
Assuming sha256:c5515758d4c5e1e838e9cd307f6c6a0d620b5e07e6f927b07d05f6d12a1ac8d7
is the manifest digest for the image hello-world:latest
.
Delete image by manifest digest
az acr repository delete --name MyRegistry --image hello-world@sha256:c5515758d4c5e1e838e9cd307f6c6a0d620b5e07e6f927b07d05f6d12a1ac8d7
Ask for confirmation, this will delete the manifest sha256:c5515758d4c5e1e838e9cd307f6c6a0d620b5e07e6f927b07d05f6d12a1ac8d7
from repository hello-world
and all tags referencing it. This will further result in automatic layer data purging.
Delete image by tag
az acr repository delete --name MyRegistry --image hello-world:latest
Ask for confirmation, this will delete the manifest that is referenced by tag latest
(e.g., sha256:c5515758d4c5e1e838e9cd307f6c6a0d620b5e07e6f927b07d05f6d12a1ac8d7
) from repository hello-world
and all tags referencing it. This will further result in automatic layer data purging.
Delete a tag
az acr repository untag --name MyRegistry --image hello-world:latest
This will simply delete the tag latest
from repository hello-world
. The image hello-world:latest
can no longer be pulled, but the manifest sha256:c5515758d4c5e1e838e9cd307f6c6a0d620b5e07e6f927b07d05f6d12a1ac8d7
and all associated layer data still exist.
Delete a repository
az acr repository delete --name MyRegistry --repository hello-world
The same as the current implementation. All tags, manifests, and layer data will be deleted.
Any suggestions are appreciated.
Issue Analytics
- State:
- Created 6 years ago
- Reactions:2
- Comments:8 (8 by maintainers)
Top GitHub Comments
@mmacy We tried to avoid the word
delete
sinceuntag
operation doesn’t delete data and each tag is more of an alias to a manifest.@chwarr Yes the two commands are identical. This is not a breaking change so the old commands can still work.