Skip to content

Instantly share code, notes, and snippets.

@iledarn
Last active August 10, 2020 07:11
Show Gist options
  • Save iledarn/e1fbb39f893720be74e8f8509d9e9310 to your computer and use it in GitHub Desktop.
Save iledarn/e1fbb39f893720be74e8f8509d9e9310 to your computer and use it in GitHub Desktop.

https://stackoverflow.com/questions/34878808/finding-docker-container-processes-from-host-point-of-view

docker top
docker-compose top odoo
docker inspect -f '{{.State.Pid}}' <container id>
docker inspect -f '{{.State.Pid}}' gerner_odoo_1

the process run in a docker container is a child of a process named containerd-shim (in Docker v18.09.4)

  • First figure out the process IDs of the containerd-shim processes.
  • For each of them, find their child process.
pgrep containerd-shim
7105
7141
7248
pgrep -P 7105
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment