'How to call this command "docker pull testacr.azurecr.io/hello-world:v1" using .NET SDK Library
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"
Solution 1:[1]
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
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 |