0

I have created Azure Container Registry and deployed sample image "hello-world", I have requirement to read the labels under the tags for hello-world image, for example if I have a tag called "v1", how I can pull label information, How to call this command "docker pull testacr.azurecr.io/hello-world:v1" using .NET SDK Library

Basically my question how to call "docker pull" command from .Net Core SDK ?

Any .Net SDK available for calling "docker pull"

enter image description here

DeepDave-MT
  • 1,861
  • 1
  • 5
  • 18
  • you can run any commands from c# code, it can be normal dir or docker pull. just follow https://stackoverflow.com/questions/1469764/run-command-prompt-commands – Manish Apr 28 '22 at 09:59

1 Answers1

0

Basically my question how to call "docker pull" command from .Net Core SDK ?

Yes, you can use docker pull under pwsh.

For example, docker-pull-image.yml:

parameters: 
  - name: ContainerRegistryClientId
    type: string
  - name: ContainerRegistryClientSecret
    type: string
  - name: ImageId
    type: string
steps:
- pwsh: |
    $containerRegistry = ("${{parameters.ImageId}}" -split "\/")[0]
    docker login $containerRegistry -u "${{ parameters.ContainerRegistryClientId }}" -p "${{ parameters.ContainerRegistryClientSecret }}"
  displayName: Login container registry
- pwsh: |
    docker pull '${{ parameters.ImageId}}'
  displayName: Pull docker image ${{ parameters.ImageId }}

You can refer to Docker images for ASP.NET Core and dotnet-docker

DeepDave-MT
  • 1,861
  • 1
  • 5
  • 18