'Docker exec command is failing with EXIT CODE 137

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.



Solution 1:[1]

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

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 vanelo