add support for docker hub mirrors

This commit is contained in:
David Kovari 2024-01-09 21:14:01 -06:00
parent ca7005705e
commit 9fd3d62a56
No known key found for this signature in database
GPG key ID: EA46A9DC0364BD76

View file

@ -84,6 +84,10 @@ if [[ "${PLUGIN_AUTO_TAG:-}" == "true" ]]; then
fi fi
fi fi
if [ -n "${PLUGIN_MIRRORS:-}" ]; then
MIRROR="$(echo $PLUGIN_MIRRORS | tr ',' '\n' | while read mirror; do echo "--registry-mirror=${mirror}"; done)"
fi
if [ -n "${PLUGIN_TAGS:-}" ]; then if [ -n "${PLUGIN_TAGS:-}" ]; then
DESTINATIONS=$(echo "${PLUGIN_TAGS}" | tr ',' '\n' | while read tag; do echo "--destination=${REGISTRY}/${PLUGIN_REPO}:${tag} "; done) DESTINATIONS=$(echo "${PLUGIN_TAGS}" | tr ',' '\n' | while read tag; do echo "--destination=${REGISTRY}/${PLUGIN_REPO}:${tag} "; done)
elif [ -f .tags ]; then elif [ -f .tags ]; then
@ -106,4 +110,5 @@ fi
${CACHE_REPO:-} \ ${CACHE_REPO:-} \
${TARGET:-} \ ${TARGET:-} \
${BUILD_ARGS:-} \ ${BUILD_ARGS:-} \
${BUILD_ARGS_FROM_ENV:-} ${BUILD_ARGS_FROM_ENV:-} \
${MIRROR}