Created
November 8, 2017 12:49
-
-
Save amadeu01/b7247cce799cf5be72dccfecb191d543 to your computer and use it in GitHub Desktop.
Magic bash
This file contains 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 characters
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