浏览代码

Update to use new "DockerFroms" (and "ArchLastStageFrom") function

See https://github.com/docker-library/official-images/pull/5929
Tianon Gravi 6 年之前
父节点
当前提交
35dab1c8ca

+ 2 - 2
.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" -}}

+ 1 - 1
.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" )

+ 2 - 2
.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:*)