Things on this page are fragmentary and immature notes/thoughts of the author. Please read with your own judgement!
According to Container exits with non-zero exit code 137, there are 2 possible reasons that have caused this.
-
The container received a docker stop, and the application did not gracefully handle SIGTERM (kill -15) — whenever a SIGTERM has been issued, the docker daemon waits 10 seconds then issue a SIGKILL (kill -9) to guarantee the shutdown.
-
The application hit an out-of-memory (OOM) condition.
Since the exit code happened during the building of a Docker image, it means that there is an out-of-meory (OOM) error happend. You can try building your Docker image using a machine with a larger memory. Notice that if you are running Docker in a VM (e.g., via Docker Machine or Docker for Mac), you can increase the memory limit to the VM. For example, if you are building Docker images on Mac, follow the instructions below to increase the memory limit for Docker.
-
Click on the whale icon of Docker.
-
Click on "Preferences..." in pop-up menu.
-
Click on the "Advanced" Tab.
-
Increase memory and swap to the desired amount.
References
https://stackoverflow.com/questions/45363771/docker-build-from-dockerfile-with-more-memory