@@ -32,6 +32,22 @@ dirCommit() {
32
32
)
33
33
}
34
34
35
+ getArches () {
36
+ local repo=" $1 " ; shift
37
+ local officialImagesUrl=' https://github.com/docker-library/official-images/raw/master/library/'
38
+
39
+ eval " declare -g -A parentRepoToArches=( $(
40
+ find -name ' Dockerfile' -exec awk '
41
+ toupper($1) == "FROM" && $2 !~ /^(' " $repo " ' |scratch|microsoft\/[^:]+)(:|$)/ {
42
+ print "' " $officialImagesUrl " ' " $2
43
+ }
44
+ ' ' {}' + \
45
+ | sort -u \
46
+ | xargs bashbrew cat --format ' [{{ .RepoName }}:{{ .TagName }}]="{{ join " " .TagEntry.Architectures }}"'
47
+ ) )"
48
+ }
49
+ getArches ' wordpress'
50
+
35
51
cat << -EOH
36
52
# this file is generated via https://github.com/docker-library/wordpress/blob/$( fileCommit " $self " ) /$self
37
53
@@ -96,9 +112,13 @@ for phpVersion in "${phpVersions[@]}"; do
96
112
fullAliases+=( " ${phpVersionAliases[@]} " )
97
113
fi
98
114
115
+ variantParent=" $( awk ' toupper($1) == "FROM" { print $2 }' " $dir /Dockerfile" ) "
116
+ variantArches=" ${parentRepoToArches[$variantParent]} "
117
+
99
118
echo
100
119
cat << -EOE
101
120
Tags: $( join ' , ' " ${fullAliases[@]} " )
121
+ Architectures: $( join ' , ' $variantArches )
102
122
GitCommit: $commit
103
123
Directory: $dir
104
124
EOE
@@ -148,9 +168,13 @@ for phpVersion in "${phpVersions[@]}"; do
148
168
" ${phpVersionVariantAliases[@]} "
149
169
)
150
170
171
+ variantParent=" $( awk ' toupper($1) == "FROM" { print $2 }' " $dir /Dockerfile" ) "
172
+ variantArches=" ${parentRepoToArches[$variantParent]} "
173
+
151
174
echo
152
175
cat << -EOE
153
176
Tags: $( join ' , ' " ${fullAliases[@]} " )
177
+ Architectures: $( join ' , ' $variantArches )
154
178
GitCommit: $commit
155
179
Directory: $dir
156
180
EOE
0 commit comments