Skip to content

Instantly share code, notes, and snippets.

@canhnt
Last active May 15, 2019 14:26
Show Gist options
  • Save canhnt/69a1b51f27cab796483587720771b25b to your computer and use it in GitHub Desktop.
Save canhnt/69a1b51f27cab796483587720771b25b to your computer and use it in GitHub Desktop.

Container killed by OOM

When a container exit with code 137, it means the process is killed by OOM Killer

docker container ls -a
"task: non-zero exit (137)"

Check OOM in journal log

journalctl -k | grep -i -e memory -e oom

Find container from given PID

# pstree -sg 17619
systemd(1)---containerd(1169)---containerd-shim(17257)---tini(17401)---java(17619)-+-{java}(17619)

# docker ps -q | xargs -i docker inspect {} --format '{{.State.Pid}}, {{.Name}}' | grep '17401'

17401, /k8s_jenkins-ecommerce-jenkins-master_jenkins-ecommerce-jenkins-master-7c6c4d48bb-cb674_jenkins-xxx-11e9-9a54-0050569522dd_0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment