question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[ACR] Design discussion for az acr repository command group

See original GitHub issue

Description

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.

/cc @SajayAntony @sivagms @SteveLasker

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:2
  • Comments:8 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
djyoucommented, Feb 23, 2018

@mmacy We tried to avoid the word delete since untag operation doesn’t delete data and each tag is more of an alias to a manifest.

1reaction
djyoucommented, Feb 23, 2018

@chwarr Yes the two commands are identical. This is not a breaking change so the old commands can still work.

Read more comments on GitHub >

github_iconTop Results From Across the Web

az acr repository | Microsoft Learn
az acr repository delete. Edit. Delete a repository or image in an Azure Container Registry. This command deletes all associated layer data that...
Read more >
Deploy an application for Azure Container Registry (Part 2
Next, we will create an Azure Container Registry instance in your resource group by using the az acr create command. az acr create...
Read more >
Newest 'acr' Questions - Stack Overflow
At my company, we're setting up an on-prem k8s cluster in combination with a private image repository hosted on Azure (Azure Container Registry)....
Read more >
Secure access to ACR - Azure Video Tutorial - LinkedIn
In Azure CLI, the firewall is turned on by the following command, az acr update, name of my container registry, and default-action Deny....
Read more >
ACR - Coding With Taz
az acr create --resource-group devops-rg --name devcrdevopsuks --sku Basic ... Now we have an ACR and a repository we can start going through...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found