How to run a docker image on Azure devops agent with docker task V2?

Viewed 1676

It's easy with docker task V1. It can run docker image from Azure Container Registry.

But with docker task V2, I can't find a way to run an image.

If I push the image with V2 and try to run it with V1, I can't set the 'latest' tag when I push with V2, but I need it when I run it with V1.

There must be a way to do it with docker task V2 I assume?

1 Answers

For docker task v2, in fact, you can input the run command manually in that blank:

- task: Docker@2
  displayName: run
  inputs:
    containerRegistry: Merlindockerhub
    repository: 650301
    command: run
    arguments: '{image}'

For v2, we provide the support for inputting commands manually, no matter you configure it with UI or YAML. Both of them are all support.

enter image description here

Related