From 35dab1c8ca79b03a002239878a9b12dc0cf88beb Mon Sep 17 00:00:00 2001 From: Tianon Gravi Date: Thu, 13 Jun 2019 16:45:28 -0700 Subject: [PATCH] Update to use new "DockerFroms" (and "ArchLastStageFrom") function See https://github.com/docker-library/official-images/pull/5929 --- .template-helpers/generate-dockerfile-links-partial.tmpl | 4 ++-- .template-helpers/git-prefetch.sh | 2 +- .template-helpers/variant.sh | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.template-helpers/generate-dockerfile-links-partial.tmpl b/.template-helpers/generate-dockerfile-links-partial.tmpl index 8b014de35..2ed1d0e46 100644 --- a/.template-helpers/generate-dockerfile-links-partial.tmpl +++ b/.template-helpers/generate-dockerfile-links-partial.tmpl @@ -15,7 +15,7 @@ This template defines the "Supported tags and Dockerfile links" portion of an im {{- $arch := $archSpecific | ternary arch ($e.HasArchitecture arch | ternary arch ($e.Architectures | first)) -}} {{- /* force bashbrew to "fetch" the GitCommit so that it is fully resolved */ -}} - {{- $from := $.ArchDockerFrom $arch $e -}} + {{- $froms := $.ArchDockerFroms $arch $e -}} {{- $gitRepo := $e.ArchGitRepo $arch -}} {{- $repoUrlBase := $gitRepo | replace "git://" "https://" | trimSuffixes ".git" -}} @@ -52,7 +52,7 @@ This template defines the "Supported tags and Dockerfile links" portion of an im {{- $arch := $archSpecific | ternary arch ($e.HasArchitecture arch | ternary arch ($e.Architectures | first)) -}} {{- /* force bashbrew to "fetch" the GitCommit so that it is fully resolved */ -}} - {{- $from := $.ArchDockerFrom $arch $e -}} + {{- $froms := $.ArchDockerFroms $arch $e -}} {{- $gitRepo := $e.ArchGitRepo $arch -}} {{- $repoUrlBase := $gitRepo | replace "git://" "https://" | trimSuffixes ".git" -}} diff --git a/.template-helpers/git-prefetch.sh b/.template-helpers/git-prefetch.sh index a3d98c784..b737cbce0 100755 --- a/.template-helpers/git-prefetch.sh +++ b/.template-helpers/git-prefetch.sh @@ -29,7 +29,7 @@ for tag in "$tags"; do {{- $e := $.TagEntry -}} '"$templateArchVar"' {{- if $e.HasArchitecture $arch -}} - {{- $from := $.ArchDockerFrom $arch $e -}} + {{- $froms := $.ArchDockerFroms $arch $e -}} {{- end -}} ' "$repo:$tag" &> /dev/null; then toFetch+=( "$repo:$tag" ) diff --git a/.template-helpers/variant.sh b/.template-helpers/variant.sh index eb66ec7ab..bafae6080 100755 --- a/.template-helpers/variant.sh +++ b/.template-helpers/variant.sh @@ -96,14 +96,14 @@ for tag in "${tags[@]}"; do done done -if [ "$text" ]; then +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 '{{ .ArchDockerFrom (.TagEntry.Architectures | first) .TagEntry }}' "$bbRepo:$tag")" + 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:*)