Open SillyCode opened 1 year ago
I'm using the next version V2 of Docker Compose which uses the docker CLI 'compose' command instead of the docker-compose
executable.
The task is looking for the 'docker-compose' executable and gives me an error.
Docker Compose was not found. You can provide the path to docker-compose via 'dockerComposePath'
I've found a workaround for this. Add a new Bash task to download the latest Docker Compose:
wget -Odocker-compose https://github.com/docker/compose/releases/latest/download/docker-compose-linux-x86_64
chmod a+x ./docker-compose
In my Docker Compose task (0.*) under the Advanced Options -> Docker Compose executable Path set the $(System.DefaultWorkingDirectory)/docker-compose
@shrralis thanks for sharing your workaround, you just saved my tail.
The task should be fixed to try docker compose
if docker-compose
fails though, as I just took a look at the source and it does exactly a which docker-compose
, which of course won't work with recent versions of Docker.
Here's another workaround (if you have Compose V2 as cli plugin). Specifiy the path to docker-compose as task parameter
Here's another workaround (if you have Compose V2 as cli plugin). Specifiy the path to docker-compose as task parameter
Thank you for the workaround. But is there a permanent solution that we can expect in near future?
Workaround also helped with this error which appeared today to me:
[debug]arguments:
[debug] compose
[debug] --compatibility
[debug] -f
[debug] /agent/_work/1/s/docker-compose.ci.yaml
[debug] -p
[debug] MyProject
[debug] config
##[error]unknown flag: --compatibility
Since the update to Docker Engine and using the latest Windows-2019 image release 20230214.1. (The image contains the following Docker related versions: Docker 23.0.1 and Docker Compose V2 2.16.0)
And having the following task
We are facing the following error:
The current Compose file version is not compatible with your engine version. Please upgrade your Compose file to a more recent version, or set a COMPOSE_API_VERSION in your environment.
My Docker-Compose file:
Error log:
Specifically the line
##[error]The process 'C:\ProgramData\Chocolatey\bin\docker-compose.exe' failed with exit code 1
Looking at the build log. We can see that the issue is reported actually by Choco Docker Compose.
DockerCompose@0
uses Docker Compose version fromC:\ProgramData\Chocolatey\bin\
Instead, it should take the latest Docker-Compose utility.Going ahead to get the version of the Choco Docker Compose via:
Outputted the following:
docker-compose version 1.29.2, build 5becea4c
Choco Docker Compose for reference: https://community.chocolatey.org/packages/docker-compose
As a workaround, I used below suggested solution