Meaning of docker-compose exit code?

For example, if I force a container to stop with kill, then docker-compose ps to check my containers, I get State as Exit 137. And with docker-compose stop I get Exit 1/Exit 0

As there are no documentation for exit code, can anyone please explain to me the meaning of it?

  • Debug Symfony2 in Docker with PhpStorm and Xdebug
  • Dockerizing any Angular SPA app that runs in node
  • What are differences between Docker and Octopus Deploy
  • Docker Compose volume doesn't persist files in subfolders
  • Dockerfile versioning best practice
  • Docker - can you over-allocate ram (tomcat)?
  • How can I run my docker container with installed Nginx?
  • Django + uWSGI + nginx requests hang
  • Deleting folders in docker conatiner using python
  • Cannot start docker after installation on Windows
  • Jenkins service in Docker swarm stays at 0/1 replicas
  • Browserify/Babelify gulp build malfunction in Docker container - cannot find component module
  • One Solution collect form web for “Meaning of docker-compose exit code?”

    This has not so much to do with docker as with the system it is running on. If you take a look in this table of reserved exit codes for bash, you can see the line:

    128+n   Fatal error signal "n"  kill -9 $PPID of script $? returns 137 (128 + 9)
    

    Which corresponds to the 137 you mention. It is 128 + 9 (SIGKILL), which you can see in the signal(7) man page. Normally a 0 means a clean exit and 1 there was something wrong, these two can suffice for a programmer. They can however range from 1-255, including the reserved ones mentioned above.

    This is just a short answer as I am not an expert on the subject, you can find more on this unix.stackexchange thread on default exit code when process is terminated or perhaps someone here can give a much more elaborate answer than mine.

    Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.