Skip to content

Instantly share code, notes, and snippets.

@amadeu01
Created November 8, 2017 12:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save amadeu01/b7247cce799cf5be72dccfecb191d543 to your computer and use it in GitHub Desktop.
Save amadeu01/b7247cce799cf5be72dccfecb191d543 to your computer and use it in GitHub Desktop.
Magic bash
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