'How to call image inspect properties in hosted in ACR
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/
Solution 1:[1]
You can use the azure cli (az). It has a manifest command.
az acr manifest show --registry my-acr --name hello-world:123
Solution 2:[2]
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://docs.microsoft.com/en-us/rest/api/containerregistry/manifests/get https://docs.microsoft.com/en-us/rest/api/containerregistry/blob/get
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | The Fool |
Solution 2 | Haneef Shaik |