Browse Source

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

Ignore value of `.RegistryConfig.Mirrors` when it is not a list
yosifkit 2 years ago
parent
commit
a402ab9ca9
1 changed files with 1 additions and 1 deletions
  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)
 		[];