Suggest a feature
×

Welcome to TagMyCode

Please login or create account to add a snippet.
0
0
 
0
Language: Bash
Posted by: Valery Smolyakov
Added: Jun 3, 2018 10:54 AM
Views: 17
Tags: no tags
  1. function dc_trace_cmd() {
  2.   local parent=`docker inspect -f '{{ .Parent }}' $1` 2>/dev/null
  3.   declare -i level=$2
  4.   echo ${level}: `docker inspect -f '{{ .ContainerConfig.Cmd }}' $1 2>/dev/null`
  5.   level=level+1
  6.   if [ "${parent}" != "" ]; then
  7.     echo ${level}: $parent
  8.     dc_trace_cmd $parent $level
  9.   fi
  10. }