Azure Devops pipeline Docker-Compose build with specific image name

Is it possible to build docker images with Docker compose task in Azure Devops pipelines and give it a specific name?

Because the names I get to the images look like $(Build.Repository.Name) only.

What I tried:

steps: 
- task: [email protected]
  inputs:
    containerregistrytype: 'Container Registry'
    dockerRegistryEndpoint: 'Docker_Hub'
    dockerComposeFile: '**/docker-compose.yml'
    qualifyImageNames: false
    action: 'Run a Docker Compose command'
    dockerComposeCommand: 'build'

and without the qualifyImageNames too.

I tried this also but I got an image name of xxx_{some name from the docker-compose.yaml}:

- task: [email protected]
  inputs:
    containerregistrytype: 'Container Registry'
    dockerRegistryEndpoint: 'Docker_Hub'
    dockerComposeFile: '**/docker-compose.yml'
    projectName: 'xxx'
    action: 'Build services'
    includeLatestTag: true

but I want to name the image something like myreponame/somename:latest.

I have 2 images the docker-compose need to build.

Source: Docker Questions

LEAVE A COMMENT