azure-pipelines-tasks: [BUG]: DockerCompose@0 no longer functions after removal of Docker Compose v1 from hosted agents.

New issue checklist

Task name

DockerCompose@0

Task version

0.231.0

Issue Description

Now that the removal of docker compose v1 has begun rolling out as per this GitHub issue

The dockercompose@0 task immediately fails with '##[error]Unhandled: Docker Compose was not found. You can provide the path to docker-compose via ‘dockerComposePath’ due to using the legacy docker-compose v1 command that no longer exists on the Microsoft hosted agents.

The task needs to be updated to use the newer ‘docker compose’ v2 command.

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

Ubuntu 22.04, Ubuntu 20.04, Windows Server 2019, Windows Server 2022.

Relevant log output

2024-04-02T15:02:02.8114252Z ##[section]Starting: Build Next app container images
2024-04-02T15:02:02.8120854Z ==============================================================================
2024-04-02T15:02:02.8120983Z Task         : Docker Compose
2024-04-02T15:02:02.8121080Z Description  : Build, push or run multi-container Docker applications. Task can be used with Docker or Azure Container registry.
2024-04-02T15:02:02.8121234Z Version      : 0.231.0
2024-04-02T15:02:02.8121300Z Author       : Microsoft Corporation
2024-04-02T15:02:02.8121407Z Help         : https://aka.ms/azpipes-docker-compose-tsg
2024-04-02T15:02:02.8121504Z ==============================================================================
2024-04-02T15:02:03.9655006Z ##[error]Unhandled: Docker Compose was not found. You can provide the path to docker-compose via 'dockerComposePath' 
2024-04-02T15:02:03.9669164Z ##[error]Error: Docker Compose was not found. You can provide the path to docker-compose via 'dockerComposePath' 
    at DockerComposeConnection.setDockerComposePath (/home/vsts/work/_tasks/DockerCompose_6975e2d1-96d3-4afc-8a41-498b5d34ea19/0.231.0/dockercomposeconnection.js:166:23)
    at new DockerComposeConnection (/home/vsts/work/_tasks/DockerCompose_6975e2d1-96d3-4afc-8a41-498b5d34ea19/0.231.0/dockercomposeconnection.js:22:14)
    at success (/home/vsts/work/_tasks/DockerCompose_6975e2d1-96d3-4afc-8a41-498b5d34ea19/0.231.0/dockercompose.js:35:26)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
2024-04-02T15:02:03.9673048Z ##[section]Finishing: Build Next app container images

Full task logs with system.debug enabled

 [REPLACE THIS WITH YOUR INFORMATION] 

Repro steps

steps:
- task: DockerCompose@0
  displayName: 'Build container images'
  inputs:
    containerregistrytype: 'Azure Container Registry'
    action: Build services
    projectName: '$(DOCKER-IMAGE-NAME)'
    dockerComposeFile: docker-compose-ci.yml
    qualifyImageNames: true
    additionalImageTags: '$(DOCKER-IMAGE-TAG)'
    includeLatestTag: true

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Reactions: 17
  • Comments: 29 (1 by maintainers)

Most upvoted comments

As a workaround until the task is fixed, add this to the task’s inputs:

dockerComposePath: '/usr/libexec/docker/cli-plugins/docker-compose'

Also see: https://github.com/microsoft/azure-pipelines-tasks/issues/17808

Wow, my entire company is blown away after this change 😡

Why didn’t Microsoft issue any warnings months before the change? For example: ‘This task will be deprecated, please migrate to docker-compose v2 before the 1st of April.’

Currently, I have to update about 500 microservices names from ‘Company.Project.ServiceName’ to ‘company-project-servicename’, which affects a lot of components/configs/DockerFiles entrypoints

There is my temporary workaround to download and use docker-compose v1:

  - task: Bash@3
    displayName: "Install docker-compose v1"
    inputs:
      targetType: 'inline'
      script: |
        DOCKER_CONFIG=${DOCKER_CONFIG:-$HOME/.docker}
        mkdir -p $DOCKER_CONFIG/cli-plugins
        curl -SL https://github.com/docker/compose/releases/download/1.29.2/docker-compose-Linux-x86_64 -o $DOCKER_CONFIG/cli-plugins/docker-compose
        chmod +x $DOCKER_CONFIG/cli-plugins/docker-compose

then add dockerComposePath to DockerCompose@0 task dockerComposePath: '/home/vsts/.docker/cli-plugins/docker-compose'

Docker Compose v2 is also much more strict with project names (eg cannot contain upper case characters), so this bug also needs to be addressed https://github.com/microsoft/azure-pipelines-tasks/issues/16361

Oh my, what a fine job at change management and versioning we have here 🤡

The DockerCompose@0 task is deprecated. The task uses docker-compose v1 which no longer receives update since July 2023. To use docker compose v2, use the DockerCompose@1 task.

That would be reasonable, if not for the fact that none of the message is true, in fact it is wrong in two separate ways:

  • there is no DockerCompose@1 task published in DevOps at the moment at all and work on it according to code in this repository started only a week ago
  • DockerCompose@0 already silently switched from docker-compose (v1) to docker compose (v2) breaking a whole lot of existing pipelines

Well, at least today it happened with a small increment in the task’s version number (0.242.0 to 0.242.8), which is a slight improvement over two weeks ago when the new behavior hit without any warning under an unchanged version number (0.240.2) and stayed there for ca. 24 h until it was rolled back as silently as it was introduced.

Can we have updates on this? As Docker@0 is deprecating in July. Can we start using Docker@2 in our ADO tasks?

@sandywangkpmg, @TripleEmcoder, I would like to clarify what is happening here. Initially, we planned to migrate DockerComposeV0 task to the docker compose CLI v2 but there were problems with project names due to constraints for a project name. After that we released the DockerComposeV1 task that uses the docker compose CLI v2, but the DockerComposeV0 task has been rolled back to the docker-compose CLI v1. I agree that was a little messed up and we had a small amount of time to inform users about the new major version of the task. Now we have the mention only in the release notes but I hope that we see an updated documentation about DockerComposeV1 soon. Thanks for understanding.

Related to the tasks changes: As I mentioned above, the DockerComposeV0 task is using compose v1 (if compose v1 is not found the task switches to compose v2) and the DockerComposeV1 task is using compose v2. If you want to use compose v1 in the DockerCompose after it will be removed from the images you can refer to the instructions that helps you to use compose v1 with the DockerComposeV0 task.

ok, turned out DockerCompose@1 task was released but the commit 3 days ago didn’t include docs change. I just tested using DockerCompose@1 in my pipeline and it worked. No more warning message. And the task version number is 1.242.1 image

docker-compose is deprecated. The functionality is provided by docker command itself. the command should be :

docker, with arguments compose … rest of args

Hi everyone! In my department we have experienced an issue related with the DockerCompose@1 task. The last week we changed pipeline tasks related with te build and push to ACR images, using the DockerCompose@1. We changed our services docker-compose.yml in order to omit the “version” statement" and begin directly with the service statements. But we encountered this message from pipeline: ##[error]time="2024-07-24T13:40:37Z" level=warning msg="/home/vsts/agents/3.241.0/.docker-compose.1721828409324.yml: version is obsolete" And the docker-compose.yml seems like this: image What are we missing up?

You’re not missing anything, the DockerCompose tasks add in their own docker compose files by default as extra compose files, the task owner would need to update these to also omit the version statements.

Hi @trs1991! We are using the classic editor (please take a look the image in edit of my last message). How we can achieve omit or prevent DockerCompose task add its own docker compose files?

Thanks in advance

The short answer is you can’t. It’s only a warning anyway and won’t stop your compose files from building correctly.

https://github.com/microsoft/azure-pipelines-tasks/pull/20085 This is the ticket to add DockerComposeV1, I left a message there.

Can we have updates on this? As Docker@0 is deprecating in July. Can we start using Docker@2 in our ADO tasks?

There is no other version of the task other than 0. Am I missing something here? image

There is no DockerCompose@1 or @2 version, only @0 is available. image I think @Jacko1394 @SwapnaVersion1 were referring to Docker task, there are @0/1/2 versions for Docker task, but it does’t look like compose is a supported command. image

Yes that is the whole point of the original request, there is no DockerCompose@1/2, but since DockerCompose@0 is now deprecated, there is a need for it to be developed so that support for DockerCompose v2 and above can be implemented as DockerCompose v1 has been removed from hosted agents.

yep, I understood the point of this issue. I was just answering @ashishbhatt-afk’s question. And pointing out Docker@0/1/2 don’t have compose command, so using Docker task is no help.