From 5d73eef647273185c3e8830d11a55b1bc33b63cc Mon Sep 17 00:00:00 2001 From: CrimsonFez <46582994+CrimsonFez@users.noreply.github.com> Date: Fri, 12 Jan 2024 14:23:42 -0600 Subject: [PATCH] Add support for docker hub mirrors and update image version (#1) --- Dockerfile | 2 +- plugin.sh | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 7579cd5..f776b23 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM gcr.io/kaniko-project/executor:debug-v0.19.0 +FROM gcr.io/kaniko-project/executor:v1.19.2-debug ENV HOME /root ENV USER root diff --git a/plugin.sh b/plugin.sh index 31e8cd3..08a2981 100755 --- a/plugin.sh +++ b/plugin.sh @@ -84,6 +84,10 @@ if [[ "${PLUGIN_AUTO_TAG:-}" == "true" ]]; then 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 DESTINATIONS=$(echo "${PLUGIN_TAGS}" | tr ',' '\n' | while read tag; do echo "--destination=${REGISTRY}/${PLUGIN_REPO}:${tag} "; done) elif [ -f .tags ]; then @@ -106,4 +110,5 @@ fi ${CACHE_REPO:-} \ ${TARGET:-} \ ${BUILD_ARGS:-} \ - ${BUILD_ARGS_FROM_ENV:-} + ${BUILD_ARGS_FROM_ENV:-} \ + ${MIRROR:-}