skip to Main Content

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


  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

    Login or Signup to reply.
  2. 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 to docker-compose.yaml to increase memory limit

    # docker-compose.yaml
    version: '3.8'
    services:
      app:
        image: my-app:1.0.0
        build:
          context: .
          dockerfile: ./Dockerfile 
        # ports: 
        # networks: 
        # volumes: 
        # depends_on: 
        deploy:
          resources:
            limits:
              memory: 500M
            reservations:
              memory: 128M
    

    Try changing deploy.resources.limits.memory and deploy.resources.reservations.memory

    Ref: https://docs.docker.com/compose/compose-file/deploy/#resources

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search