Skip to content

Instantly share code, notes, and snippets.

@raphaelchaib
Last active June 15, 2018 19:03
Show Gist options
  • Save raphaelchaib/a702e56778d0fe89f2b27fd19b90a2eb to your computer and use it in GitHub Desktop.
Save raphaelchaib/a702e56778d0fe89f2b27fd19b90a2eb to your computer and use it in GitHub Desktop.
function dc_trace_cmd() {
local parent=`docker inspect -f '{{ .Parent }}' $1` 2>/dev/null
declare -i level=$2
echo ${level}: `docker inspect -f '{{ .ContainerConfig.Cmd }}' $1 2>/dev/null`
level= level + 1
if [ "${parent}" != "" ]; then
echo ${level}: $parent
dc_trace_cmd $parent $level
fi
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment