skip to Main Content

I have few images hosted in ACR, I want to inspect the image (Repository image) deployed in ACR.

For example I have one "hello-world" image in "test123" ACR. I want to inspect ACR image and read the json content of the image. I didn’t see any suitable .NET packages or .NET SDK libraries.

how to run "docker image inspect test123.azurecr.io/hello-world:v3" using .NET SDK libraries by connecting AZURE Container Registry (ACR) ?

I have tried following packages, but I didn’t see any support to get similar command using .NET Libraries.

https://www.nuget.org/packages/Microsoft.Azure.Management.ContainerService/

https://www.nuget.org/packages/Docker.DotNet/

https://github.com/dotnet/dotnet-docker

2

Answers


  1. Chosen as BEST ANSWER

    Finally I got answer for my question. We can use Http V2 API capabilities to retrieve Manifest or Config information to retrieve.

    To get manifest information below is the URL's

    GET {url}/v2/{name}/manifests/{reference} https://test.azurecr.io/v2/{imageName}/manifests/Sha:25635dfger4656454fggf

    GET {url}/v2/{name}/blobs/{digest} https://test.azurecr.io/v2/{imageName}/blobs/Sha:4534afdf33289988956565

    Note: There are different digest's available for image. You will see one digest for entire Manifest and different digest for Config of Manifest section.

    Please find below documentation https://learn.microsoft.com/en-us/rest/api/containerregistry/manifests/get https://learn.microsoft.com/en-us/rest/api/containerregistry/blob/get


  2. You can use the azure cli (az). It has a manifest command.

    az acr manifest show --registry my-acr --name hello-world:123
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search