Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adjust "repo:<version>" text ordering to more explicitly recommend "-suite" variants #1573

Merged
merged 1 commit into from
Sep 13, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .template-helpers/variant-default-debian.md
Original file line number Diff line number Diff line change
@@ -1 +1 @@
Some of these tags may have names like %%DEB-SUITES%% in them. These are the suite code names for releases of [Debian](https://wiki.debian.org/DebianReleases) and indicate which release the image is based on.
Some of these tags may have names like %%DEB-SUITES%% in them. These are the suite code names for releases of [Debian](https://wiki.debian.org/DebianReleases) and indicate which release the image is based on. If your image needs to install any additional packages beyond what comes with the image, you'll likely want to specify one of these explicitly to minimize breakage when there are new releases of Debian.
2 changes: 1 addition & 1 deletion .template-helpers/variant-default-ubuntu.md
Original file line number Diff line number Diff line change
@@ -1 +1 @@
Some of these tags may have names like %%DEB-SUITES%% in them. These are the suite code names for releases of [Ubuntu](https://wiki.ubuntu.com/Releases) and indicate which release the image is based on.
Some of these tags may have names like %%DEB-SUITES%% in them. These are the suite code names for releases of [Ubuntu](https://wiki.ubuntu.com/Releases) and indicate which release the image is based on. If your image needs to install any additional packages beyond what comes with the image, you'll likely want to specify one of these explicitly to minimize breakage when there are new releases of Ubuntu.
33 changes: 17 additions & 16 deletions .template-helpers/variant.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ join() {

commaJoin() {
local items=( $(xargs -n1 <<<"$1" | sort -u) ); shift
sep=', '

local sep=', '
case "${#items[@]}" in
0)
return
Expand Down Expand Up @@ -100,21 +101,6 @@ if [ -n "$text" ]; then
default="$([ -f "$repoDir/variant.md" ] && cat "$repoDir/variant.md" || cat "$dir/variant.md")"
default+=$'\n' # parameter expansion eats the trailing newline

# buildpack-deps text
potentialTags="$(bashbrew list --uniq "$bbRepo" | cut -d: -f2)"
for tag in $potentialTags; do
baseImage="$(bashbrew cat -f '{{ .ArchLastStageFrom (.TagEntry.Architectures | first) .TagEntry }}' "$bbRepo:$tag" 2>/dev/null)"
case "$baseImage" in
buildpack-deps:*-*) ;; # "scm", "curl" -- not large images
buildpack-deps:*)
default+=$'\n' # give a little space
default+="$(< "$dir/variant-default-buildpack-deps.md")"
default+=$'\n' # parameter expansion eats the trailing newline
break
;;
esac
done

if [ "$repo" != 'debian' ] && [ "$repo" != 'ubuntu' ]; then
# what is 'jessie', 'stretch' and 'sid'
# https://github.com/docker-library/python/issues/343
Expand Down Expand Up @@ -151,6 +137,21 @@ if [ -n "$text" ]; then
fi
fi

# buildpack-deps text
potentialTags="$(bashbrew list --uniq "$bbRepo" | cut -d: -f2)"
for tag in $potentialTags; do
baseImage="$(bashbrew cat -f '{{ .ArchLastStageFrom (.TagEntry.Architectures | first) .TagEntry }}' "$bbRepo:$tag" 2>/dev/null)"
case "$baseImage" in
buildpack-deps:*-*) ;; # "scm", "curl" -- not large images
buildpack-deps:*)
default+=$'\n' # give a little space
default+="$(< "$dir/variant-default-buildpack-deps.md")"
default+=$'\n' # parameter expansion eats the trailing newline
break
;;
esac
done

echo
echo

Expand Down