If you are trying to add a task to VSTS pipeline to start the docker container using docker-compose and getting this error when the build task is run then the problem is with the command.

Screen shot-

 

 

Error observed:

2018-10-18T01:43:32.6124298Z No such command: docker_compose
2018-10-18T01:43:32.6133566Z
2018-10-18T01:43:32.6150579Z Commands:
2018-10-18T01:43:32.6167852Z build Build or rebuild services
2018-10-18T01:43:32.6185675Z bundle Generate a Docker bundle from the Compose file
2018-10-18T01:43:32.6204453Z config Validate and view the Compose file
2018-10-18T01:43:32.6222494Z create Create services
2018-10-18T01:43:32.6239909Z down Stop and remove containers, networks, images, and volumes
2018-10-18T01:43:32.6257460Z events Receive real time events from containers
2018-10-18T01:43:32.6275384Z exec Execute a command in a running container
2018-10-18T01:43:32.6293901Z help Get help on a command
2018-10-18T01:43:32.6311061Z images List images
2018-10-18T01:43:32.6327970Z kill Kill containers
2018-10-18T01:43:32.6345732Z logs View output from containers
2018-10-18T01:43:32.6363659Z pause Pause services
2018-10-18T01:43:32.6382533Z port Print the public port for a port binding
2018-10-18T01:43:32.6400313Z ps List containers
2018-10-18T01:43:32.6416953Z pull Pull service images
2018-10-18T01:43:32.6435520Z push Push service images
2018-10-18T01:43:32.6453201Z restart Restart services
2018-10-18T01:43:32.6470194Z rm Remove stopped containers
2018-10-18T01:43:32.6488071Z run Run a one-off command
2018-10-18T01:43:32.6506661Z scale Set number of containers for a service
2018-10-18T01:43:32.6525838Z start Start services
2018-10-18T01:43:32.6543415Z stop Stop services
2018-10-18T01:43:32.6562450Z top Display the running processes
2018-10-18T01:43:32.6579752Z unpause Unpause services
2018-10-18T01:43:32.6596989Z up Create and start containers
2018-10-18T01:43:32.6615998Z version Show the Docker-Compose version information

 

Solution:

Instead of ‘docker-compose up’ command, just add ‘up’ in the command as shown in screen shot below-