3

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.

1 Answer 1

1

After tinkering around a bit more I realized that my file permissions were insufficient. After doing a chmod 777 it worked.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.