Detect if base image uses buildpack-deps

This commit is contained in:
William Blankenship
2015-03-16 19:08:12 -05:00
parent adfd93e313
commit 78d6ca1359
+12 -6
View File
@@ -9,9 +9,10 @@ if [ -z "$repo" ]; then
fi
dir="$(dirname "$(readlink -f "$BASH_SOURCE")")"
url='https://raw.githubusercontent.com/docker-library/official-images/master/library/'"$repo"
IFS=$'\n'
tags=( $(curl -sSL 'https://raw.githubusercontent.com/docker-library/official-images/master/library/'"$repo" | grep -vE '^$|^#' | cut -d':' -f1 | sort -u) )
tags=( $(curl -sSL $url | grep -vE '^$|^#' | cut -d':' -f1 | sort -u) )
unset IFS
text=
@@ -23,9 +24,14 @@ for tag in "${tags[@]}"; do
fi
done
if [ "$text" ]; then
# give a little space
echo
echo
cat "$dir/variant.md"
echo "$text"
latest=($(curl -sSL $url | sed -e 's/git:\/\/github.com\///' -e 's/@/ /' - | grep "latest"))
dockerfile='https://raw.githubusercontent.com/'"${latest[1]}"'/'"${latest[2]}"'/'"${latest[3]}"'/Dockerfile'
base_image=$(curl -sSL $dockerfile | sed 's/:/\t/' | nawk '/^FROM .*$/ { print $2 }')
if [ "$base_image" = "buildpack-deps" ]; then
# give a little space
echo
echo
cat "$dir/variant.md"
echo "$text"
fi
fi