tuto1: script to count layers
This commit is contained in:
parent
081541eb04
commit
021d1ba92a
1 changed files with 12 additions and 0 deletions
12
tutorial/1/misc/count_layers.sh
Executable file
12
tutorial/1/misc/count_layers.sh
Executable file
|
|
@ -0,0 +1,12 @@
|
|||
#!/bin/sh
|
||||
|
||||
IMG="$1"
|
||||
NLAYER=0
|
||||
|
||||
while [ "$IMG" != "" ] && [ "$IMG" != "null" ]
|
||||
do
|
||||
IMG=$(docker inspect "$IMG" | jq .[0].Parent | tr -d '"')
|
||||
NLAYER=$(($NLAYER + 1))
|
||||
done
|
||||
|
||||
echo $1 image has $NLAYER layers.
|
||||
Loading…
Add table
Add a link
Reference in a new issue