mirror of
https://github.com/clearlinux/docs.git
synced 2026-09-02 03:41:36 +00:00
Detect if base image uses buildpack-deps
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user