title: Docker: The command returned a non-zero code: 137
body: <p>My docker file is as follows:</p>
  <pre><code>#Use python 3.6 image
  FROM python:3.6
  ENV PYTHONUNBUFFERED 1
  
  #install required packages
  RUN apt-get update
  RUN apt-get install libsasl2-dev libldap2-dev libssl-dev python3-dev psmisc -y
  
  #install a pip package
  #Note: This pip package has a completely configured django project in it
  RUN pip install &lt;pip-package&gt;
  
  #Run a script
  #Note: Here appmanage.py is a file inside the pip installed location(site-packages), but it will be accessible directly without cd to the folder
  RUN appmanage.py appconfig appadd.json
  
  #The &lt;pip-packge&gt; installed comes with a built in django package, so running it with following CMD
  #Note: Here manage.py is present inside the pip package folder but it is accesible directly
  CMD [&quot;manage.py&quot;,&quot;runserver&quot;,&quot;0.0.0.0:8000&quot;]
  </code></pre>
  <p>When i run :</p>
  <pre><code>sudo docker build -t test-app .
  </code></pre>
  <p>The steps in dockerfile till: <code>RUN appmanage.py appconfig </code> runs sucessfully as expected but after that i get the error:</p>
  <pre><code>The command '/bin/sh -c appmanage.py appconfig ' returned a non-zero code: 137
  </code></pre>
  <p>When i google for the error i get suggestions like memory is not sufficient. But i have verified, the system(centos) is having enough memory.</p>
  <h1>Additional info</h1>
  <p>The commandline output during the execution of <code>RUN appmanage.py appconfig</code> is :</p>
  <pre><code>Step 7/8 : RUN appmanage.py appconfig
   ---&gt; Running in 23cffaacc81f
  
  ======================================================================================
  configuring katana apps...
   Please do not quit (or) kill the server manually, wait until the server closes itself...!
  ======================================================================================
  Performing system checks...
  
  System check identified no issues (0 silenced).
  February 08, 2020 - 12:01:45
  Django version 2.1.2, using settings 'katana.wui.settings'
  Starting development server at http://127.0.0.1:9999/
  Quit the server with CONTROL-C.
  9999/tcp:
      20Killed
  </code></pre>