azure-pipelines-tasks: [REGRESSION]: DockerCompose@0 no longer supports default projectName for GitHub Repostitories

New issue checklist

Task name

DockerCompose@0

Breaking task version

0.239.0

Last working task version

0.238.0

Regression Description

This functionality was broken in version 0.239.0, but is not observable unless the flag USE_DOCKER_COMPOSE_V2_COMPATIBLE_MODE is true.

The DockerCompose@0 task defaults projectName to ‘$(Build.Repository.Name)’. However, GitHub repositories have a forward slash (/) in their name, and the forward slash is an invalid property for projectName when calling docker compose. I’m not sure why this only just broke, but manually specifying a project name that does not include the slash works.

Environment type (Please select at least one enviroment where you face this issue)

  • Self-Hosted
  • Microsoft Hosted
  • VMSS Pool
  • Container

Azure DevOps Server type

dev.azure.com (formerly visualstudio.com)

Azure DevOps Server Version (if applicable)

No response

Operation system

windows-2019

Relevant log output

Starting: Build Image
==============================================================================
Task         : Docker Compose
Description  : Build, push or run multi-container Docker applications. Task can be used with Docker or Azure Container registry.
Version      : 0.240.2
Author       : Microsoft Corporation
Help         : https://aka.ms/azpipes-docker-compose-tsg
==============================================================================
##[error]The process 'C:\Windows\system32\docker.exe' failed with exit code 15
Finishing: Build Image

Full task logs with system.debug enabled

UNSUCCESSFUL RUN
 [REPLACE THIS WITH YOUR INFORMATION] 
SUCCESSFUL RUN
 [REPLACE THIS WITH YOUR INFORMATION] 

Repro steps

https://github.com/dhavemeyer-symplr/ado-pipeline-docker-compose-error

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Reactions: 9
  • Comments: 21 (9 by maintainers)

Most upvoted comments

Hi,

All our azure devops pipelines have started to fail with the following message:

Starting: Build services

Task : Docker Compose Description : Build, push or run multi-container Docker applications. Task can be used with Docker or Azure Container registry. Version : 0.240.2 Author : Microsoft Corporation Help : https://aka.ms/azpipes-docker-compose-tsg

##[error]invalid project name “Company.Project.Component”: must consist only of lowercase alphanumeric characters, hyphens, and underscores as well as start with a letter or number ##[error]The process ‘/usr/bin/docker’ failed with exit code 15 Finishing: Build services

This has been working until now, all our different repositories are named like this <Company>.<Project>.<Component> with PascalCasing and it was never a problem.

This is the task we’re using:

 - task: DockerCompose@0
      displayName: 'Build services'
      inputs:
        containerregistrytype: 'Azure Container Registry'
        dockerComposeFile: 'docker-compose.yml'
        dockerComposeFileArgs: |
          BuildConfiguration=$(BuildConfiguration)
          ASPNETCORE_ENVIRONMENT='Production'
          ImageName=$(imageName)
          TOKEN_NPM=$(TOKEN_NPM)
        action: 'Build services'
        additionalImageTags: '$(tag)'`

@v-schhabra I believe it is still an issue. I don’t expect it to fail if I omit an optional configuration and the default value is not adhering to the standard

Are we saying we need to modify the 20+ projects that are using this to include this change on the pipeline? Any implications to that?

@v-schhabra thanks for looking into it. That worked:

  - task: DockerCompose@0
    displayName: Pull docker images
    inputs:
       projectName: test
    ...

The issue has returned for us as well. We are looking for guidance on how to fix.

We got it working during this previous days and started failing again today. Any suggestions?

Hi,

All our azure devops pipelines have started to fail with the following message:

Starting: Build services

Task : Docker Compose Description : Build, push or run multi-container Docker applications. Task can be used with Docker or Azure Container registry. Version : 0.240.2 Author : Microsoft Corporation Help : https://aka.ms/azpipes-docker-compose-tsg

##[error]invalid project name “Company.Project.Component”: must consist only of lowercase alphanumeric characters, hyphens, and underscores as well as start with a letter or number ##[error]The process ‘/usr/bin/docker’ failed with exit code 15 Finishing: Build services

This has been working until now, all our different repositories are named like this … with PascalCasing and it was never a problem.

This is the task we’re using:

 - task: DockerCompose@0
      displayName: 'Build services'
      inputs:
        containerregistrytype: 'Azure Container Registry'
        dockerComposeFile: 'docker-compose.yml'
        dockerComposeFileArgs: |
          BuildConfiguration=$(BuildConfiguration)
          ASPNETCORE_ENVIRONMENT='Production'
          ImageName=$(imageName)
          TOKEN_NPM=$(TOKEN_NPM)
        action: 'Build services'
        additionalImageTags: '$(tag)'`

We are already working on this issue. Will keep here posted the latest updates.