Created
October 6, 2017 18:39
-
-
Save jsidhu/d6924f549df7f2f440a6e8af109f9d08 to your computer and use it in GitHub Desktop.
Revisions
-
jsidhu created this gist
Oct 6, 2017 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,16 @@ #!/bin/bash cpid=$1 while true; do ppid=$(ps -o ppid= -p $cpid) pname=$(ps -o comm= -p $ppid) if [ "$pname" == "docker" ]; then echo "$cpid parent $ppid ($pname)" break else echo "$cpid parent $ppid ($pname)" cpid=$ppid fi done docker ps -q | xargs docker inspect --format '{{.State.Pid}}, {{.Name}}' | grep $cpid