I am trying to get docker-compose to run in the Azure Dev Ops pipeline with my yaml file but I keep getting errors like the following
##[error]Unhandled: Unable to locate executable file: 'docker-compose.yml'. Please verify either the file path exists or the file can be found within a directory specified by the PATH environment variable. Also check the file mode to verify the file is executable.
I know that the file exists in the directory structure however as proven from my yaml script output.
# task1 - print directories
- script:
echo '------Current directory is------'
pwd
echo '------directories in current directory is------'
ls
echo '------cd into dir_1------'
cd dir_1
echo '------Current directory is------'
pwd
echo '------directories in current directory is------'
ls
# end task1
- task: DockerCompose@0
displayName: docker compose - Build services
inputs:
action: Build services
azureSubscriptionEndpoint: <redacted>
azureContainerRegistry: <redacted>
containerregistrytype: <redacted>
dockerComposePath: '/agent/_work/6/s/dir_1/docker-compose.yml'
#dockerComposeFile: docker-compose.yml
projectName: a_test
qualifyImageNames: true
additionalImageTags: $(Build.BuildId)
dockerComposeFileArgs: |
firstArg=$(firstArg)
secondArg=$(secondArg)
The output of the script is the following
------Current directory is------
/agent/_work/6/s
------directories in current directory is------
BuildPushDockerImage.yaml
<redacted>
docker-compose.yml
docker-compose.yml.exe
dir_1
------cd into dir_1------
------Current directory is------
/agent/_work/6/s/dir_1
------directories in current directory is------
<redacted>
docker-compose.yaml
but I keep getting the unable to locate executable file error. I have tried various other variations as well as listed below but no luck
1.
#dockerComposePath: ./docker-compose.yml
dockerComposeFile: docker-compose.yml
##[error]Unhandled: Docker Compose was not found. You can provide the path to docker-compose via 'dockerComposePath'
2.
dockerComposePath: ./docker-compose.yml
dockerComposeFile: docker-compose.yml
##[error]Unhandled: Unable to locate executable file: './docker-compose.yml'. Please verify either the file path exists or the file can be found within a directory specified by the PATH environment variable. Also check the file mode to verify the file is executable.
3.
dockerComposePath: docker-compose.yml
dockerComposeFile: docker-compose.yml
##[error]Unhandled: Unable to locate executable file: 'docker-compose.yml'. Please verify either the file path exists or the file can be found within a directory specified by the PATH environment variable. Also check the file mode to verify the file is executable.
4.
#dockerComposePath: docker-compose.yml
#dockerComposeFile: docker-compose.yml
##[error]Unhandled: Docker Compose was not found. You can provide the path to docker-compose via 'dockerComposePath'
5.
dockerComposePath: docker-compose.yml
#dockerComposeFile: docker-compose.yml
##[error]Unhandled: Unable to locate executable file: 'docker-compose.yml'. Please verify either the file path exists or the file can be found within a directory specified by the PATH environment variable. Also check the file mode to verify the file is executable.
6.
dockerComposePath: dir_1/docker-compose.yml
#dockerComposeFile: docker-compose.yml
##[error]Unhandled: Unable to locate executable file: 'dir_1/docker-compose.yml'. Please verify either the file path exists or the file can be found within a directory specified by the PATH environment variable. Also check the file mode to verify the file is executable.
7.
dockerComposePath: /agent/_work/6/s/dir_1/docker-compose.yml
#dockerComposeFile: docker-compose.yml
##[error]Unhandled: Unable to locate executable file: '/agent/_work/6/s/dir_1/docker-compose.yml'. Please verify either the file path exists or the file can be found within a directory specified by the PATH environment variable. Also check the file mode to verify the file is executable.
8.
dockerComposePath: '$(Pipeline.Workspace)/dir_1/docker-compose.yml'
#dockerComposeFile: docker-compose.yml
##[error]Unhandled: Unable to locate executable file: '/agent/_work/6/dir_1/docker-compose.yml'. Please verify either the file path exists or the file can be found within a directory specified by the PATH environment variable. Also check the file mode to verify the file is executable.