Update `generate-stackbrew-library.sh` to support `BASHBREW_LIBRARY` for easier cascading updates
See https://github.com/docker-library/official-images/pull/17640#issuecomment-2380308790
This commit is contained in:
parent
c632cbc38e
commit
6016bb334e
|
|
@ -49,17 +49,19 @@ dirCommit() {
|
||||||
|
|
||||||
getArches() {
|
getArches() {
|
||||||
local repo="$1"; shift
|
local repo="$1"; shift
|
||||||
local officialImagesUrl='https://github.com/docker-library/official-images/raw/master/library/'
|
local officialImagesBase="${BASHBREW_LIBRARY:-https://github.com/docker-library/official-images/raw/HEAD/library}/"
|
||||||
|
|
||||||
eval "declare -g -A parentRepoToArches=( $(
|
local parentRepoToArchesStr
|
||||||
find -name Dockerfile -exec awk '
|
parentRepoToArchesStr="$(
|
||||||
|
find -name 'Dockerfile' -exec awk -v officialImagesBase="$officialImagesBase" '
|
||||||
/^FROM/ {
|
/^FROM/ {
|
||||||
if (index($2, ":") > 0 && index($2, "'"$repo"'") == 0) {
|
if (index($2, ":") > 0 && index($2, "'"$repo"'") == 0) {
|
||||||
print "'"$officialImagesUrl"'" $2
|
printf "%s%s\n", officialImagesBase, $2
|
||||||
}
|
}
|
||||||
}' '{}' + | sort -u \
|
}' '{}' + | sort -u \
|
||||||
| xargs bashbrew cat --format '[{{ .RepoName }}:{{ .TagName }}]="{{ join " " .TagEntry.Architectures }}"'
|
| xargs -r bashbrew cat --format '["{{ .RepoName }}:{{ .TagName }}"]="{{ join " " .TagEntry.Architectures }}"'
|
||||||
) )"
|
)"
|
||||||
|
eval "declare -g -A parentRepoToArches=( $parentRepoToArchesStr )"
|
||||||
}
|
}
|
||||||
getArches 'rabbitmq'
|
getArches 'rabbitmq'
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue