In Azure pipeline - how to build docker image with multiple image tags

377 Views Asked by At
  • task: Docker@2
    inputs:
    containerRegistry: 'my-registry'
    repository: '$(System.TeamProject)/$(Build.Repository.Name)'
    command: 'buildAndPush'
    Dockerfile: 'Dockerfile'
    tags: |
    $(Build.SourceVersion)
    $(Build.SourceBranchName)

is it possible to do multiple tags for one image build?

Need to add multiple image tag for one docker build in azure pipelines

1

There are 1 best solutions below

0
4c74356b41 On

your question contains the answer:

tags: |
  $(Build.SourceVersion)
  $(Build.SourceBranchName)
  more_tags_go_here