I am running a CICD pipeline that runs a test script inside a docker container with docker exec and its failing with a return code of 137 every 3rd or 4th time. Here is the code that’s running:
docker-compose -p 1234 -f docker-compose.yml exec -T webapp run_tests.sh
STATUS=$?
...
docker-compose -p 1234 -f docker-compose.yml logs --no-color webapp
...
exit $STATUS
Thing is whenever it fails with EXIT CODE 137, container gets killed immediately and there are no logs available for debugging. I think 137 is caused by some external process but I am not able to trace it. Any insights into this will be very helpful.
2
Answers
Thanks for your question, I experience a related error and it was related to a memory limit, try to increase your swap memory.
Here a link with someone with similar problem
I experience related error too, in my case i got error when executing docker-compose exec on my Jenkins build. Fixed by add
deploy
config todocker-compose.yaml
to increase memory limitTry changing
deploy.resources.limits.memory
anddeploy.resources.reservations.memory
Ref: https://docs.docker.com/compose/compose-file/deploy/#resources