Skip to content

Instantly share code, notes, and snippets.

@xgz123
Created August 14, 2018 03:39
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 xgz123/e55e0834853608a7bcefecfbfcde5a48 to your computer and use it in GitHub Desktop.
Save xgz123/e55e0834853608a7bcefecfbfcde5a48 to your computer and use it in GitHub Desktop.
docker history
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