I am doing some tests on docker and containers and I was wondering:
Is there a method I can use to find all process associated with a docker container by its name or
the process run in a docker container is a child of a process named containerd-shim (in Docker v18.09.4)
containerd-shim processes.pgrep containerd-shim
7105 7141 7248
To find the child process of parent process 7105:
pgrep -P 7105
7127
In the end you could get the list with:
for i in $(pgrep containerd-shim); do pgrep -P $i; done
7127 7166 7275