瀏覽代碼

Merge pull request #15169 from infosiftr/ignore-null-list

Ignore value of `.RegistryConfig.Mirrors` when it is not a list
yosifkit 2 年之前
父節點
當前提交
a402ab9ca9
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      .bin/docker-buildx-ensure.sh

+ 1 - 1
.bin/docker-buildx-ensure.sh

@@ -25,7 +25,7 @@ fi
 platform="$(bashbrew cat --format '{{ ociPlatform arch }}' <(echo 'Maintainers: empty hack (@example)'))"
 
 hubMirrors="$(docker info --format '{{ json .RegistryConfig.Mirrors }}' | jq -c '
-	[ env.DOCKERHUB_PUBLIC_PROXY // empty, .[] ]
+	[ env.DOCKERHUB_PUBLIC_PROXY // empty, .[]? ]
 	| map(select(startswith("https://")) | ltrimstr("https://") | rtrimstr("/") | select(contains("/") | not))
 	| reduce .[] as $item ( # "unique" but order-preserving (we want DOCKERHUB_PUBLIC_PROXY first followed by everything else set in the dockerd mirrors config without duplication)
 		[];