docker-compose task non-zero exit code does not report as failed
See original GitHub issueTroubleshooting
Checked for alternate preview version of the docker-compose command vsts task, but did not see any. Tried both docker-compose execute command “up” and also the “run services” (which maps to up). Both have the same issue.
Environment
-
Server -
VSTS
- account name:
metabolondev
- team project name:
Aperture
- build definition name/build number:
Aperture - CI / 757
- account name:
-
Agent - Private:
- Created using docker command:
docker run -d --restart always --name vsts_default_a1 -e VSTS_ACCOUNT=metabolondev -e VSTS_TOKEN=**** -e VSTS_AGENT=a1 -e VSTS_POOL=Default -e USER=root -e VSTS_WORK=/var/vsts --log-opt max-size=5m -v /var/run/docker.sock:/var/run/docker.sock -v /var/vsts:/var/vsts microsoft/vsts-agent:ubuntu-16.04-docker-17.03.0-ce-standard
Issue Description
Docker-Compose task:
Nothing fancy, just trying to run:
docker-compose -f ./docker-compose.ci.build.yaml up
Content of that file is:
services:
ci-build:
image: node:8.9.1
volumes:
- .:/root/src
- ${HOME}/.cache:/usr/local/share/.cache
environment:
- CI=1
- USER=${USER}
working_dir: /root/src
command: /bin/bash -c "yarn install && yarn lint && yarn test:cover && yarn build"
My problem is the circled parts. Note that the build task failed on the Install / Test / Build
in the output, but that it did not mark the task as error, and did not stop, but continued to the next task, where it failed due to missing files expected to be generated from the prior step.
Please ignore for now, the control/color codes not being interpreted.
Error logs
See above.
Issue Analytics
- State:
- Created 6 years ago
- Comments:6 (3 by maintainers)
Top Results From Across the Web
How can I fix the Error of Docker-compose up exited with code 1
Exit Code 1 Indicates that the container stopped due to either an application error or an incorrect reference in Dockerfile to a file...
Read more >Azure DevOps Pipeline - Docker task failing
It seems like that the Docker@2 task got I few breaking updates on Friday. My last build on Thursday at 2:40pm (UTC +11)...
Read more >Docker Engine release notes
This release of Docker Engine contains updated versions of Docker Compose, Docker Scan, Containerd, and some minor bug fixes and enhancements. Updates ...
Read more >Bamboo does not respect exit status of docker compose
I'll need more details about the task running the docker-compose command. If you are using a script task, there is an explanation for...
Read more >Error codes for Visual Studio Container Tools - Microsoft Learn
See the Output window for more detail on why the container is failed to start. DTP1003, No service found while debugging the Docker...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@jhgoodwin Can you share the build log for Install / Test / Build step. Ensure that you set system.debug variable as true. Meanwhile you can use --exit-code-from option of up command. docker-compose -f ./docker-compose.ci.build.yaml up --exit-code-from ci-build
This should work for you. Please share the log so that we can expose --exit-code-from option in UI appropriately.
Docker-compose process does not exit with an error exit code if one of the containers fails. I tried docker-compose up && echo “Working” || echo “Not working”. It always printed “Working”. Irrespective of container exit code.
This is the reason --exit-code-from was introduced.