From 37755774e5762aa50b2e0015241a7c15cd62ff83 Mon Sep 17 00:00:00 2001 From: Arthur Le Roux Date: Wed, 31 Jan 2024 13:36:27 +0100 Subject: [PATCH] feat: add custom registry option --- README.md | 6 ++++-- docker/24-dind/entrypoint.sh | 5 +++++ 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 0ea53a0..b29058b 100644 --- a/README.md +++ b/README.md @@ -101,5 +101,7 @@ CLUSTER_EXTRA_NODES=" ## Private Registry -An access to a private registry is possible with the environment variables :` $CI_REGISTRY` `$CI_REGISTRY_USER` and `$CI_REGISTRY_PASSWORD`. -For GitLab, the variables are predifined. \ No newline at end of file +An access to GitLab private registry is possible with the environment variables :`$CI_REGISTRY` `$CI_REGISTRY_USER` and `$CI_REGISTRY_PASSWORD`. +the variables are predefined. + +For a custom private registry, an access is possible by providing the variables : `$CI_CUSTOM_REGISTRY` `$CI_CUSTOM_REGISTRY_USER` and `$CI_CUSTOM_REGISTRY_PASSWORD`. \ No newline at end of file diff --git a/docker/24-dind/entrypoint.sh b/docker/24-dind/entrypoint.sh index 88ba568..c1476ea 100644 --- a/docker/24-dind/entrypoint.sh +++ b/docker/24-dind/entrypoint.sh @@ -24,6 +24,11 @@ if [ -n "$CI_REGISTRY" ] && [ -n "$CI_REGISTRY_USER" ] && [ -n "$CI_REGISTRY_PAS docker login $CI_REGISTRY -u "${CI_REGISTRY_USER}" -p "${CI_REGISTRY_PASSWORD}" fi +if [ -n "$CI_CUSTOM_REGISTRY" ] && [ -n "$CI_CUSTOM_REGISTRY_USER" ] && [ -n "$CI_CUSTOM_REGISTRY_PASSWORD" ]; then + echo "Logging to ${CI_CUSTOM_REGISTRY} with user ${CI_REGISTRY_USER}" + docker login $CI_CUSTOM_REGISTRY -u "${CI_CUSTOM_REGISTRY_USER}" -p "${CI_CUSTOM_REGISTRY_PASSWORD}" +fi + if [ -z "$CLUSTER_NAME" ]; then export CLUSTER_NAME="kind" echo "Defaulting cluster name to ${CLUSTER_NAME}"