azure-pipelines-tasks: [BUG]: DockerCompose@0 no longer functions after removal of Docker Compose v1 from hosted agents.
New issue checklist
- I searched for existing GitHub issues
- I read pipeline troubleshooting guide
- I checked how to collect logs
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)
As a workaround until the task is fixed, add this to the task’s inputs:
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:
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:
docker-compose(v1) todocker compose(v2) breaking a whole lot of existing pipelinesWell, at least today it happened with a small increment in the task’s version number (
0.242.0to0.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
docker-compose is deprecated. The functionality is provided by docker command itself. the command should be :
docker, with arguments compose … rest of args
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.
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.