From 15f630ef86b84ff1a4086b51aed67be3578bfb26 Mon Sep 17 00:00:00 2001
From: Lucas Brandstaetter <lucas@brandstaetter.tech>
Date: Sun, 27 Oct 2024 00:25:27 +0200
Subject: [PATCH] Add REGISTRY ARG to the Dockerfile

With this we can select a registry when we need it
(e.g. GitLab dependency proxy), but it will pull from DockerHub when
no registry is chosen.
---
 .gitlab-ci.yml | 1 +
 Dockerfile     | 5 +++--
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 5b8c8b000..12aff3116 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -79,6 +79,7 @@ default:
     KANIKO_ARGS:
       --skip-unused-stages=true
       --context $CI_PROJECT_DIR
+      --build-arg REGISTRY=git.cccv.de/crews/hub/dependency_proxy/containers/
   before_script:
     - |
       cat > /kaniko/.docker/config.json <<EOF
diff --git a/Dockerfile b/Dockerfile
index 33e08b90d..2a9d261f1 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -1,4 +1,5 @@
-FROM git.cccv.de/crews/hub/dependency_proxy/containers/python:3.13-bookworm as base
+ARG REGISTRY=""
+FROM ${REGISTRY}python:3.13-bookworm as base
 
 ARG DEVELOPMENT=False
 
@@ -80,7 +81,7 @@ RUN export DJANGO_SETTINGS_MODULE='hub.settings.build' && \
 
 ######################################### [nginx] #############################
 
-FROM git.cccv.de/crews/hub/dependency_proxy/containers/nginx:1.25-alpine-slim as nginx-forwarder
+FROM ${REGISTRY}nginx:1.25-alpine-slim as nginx-forwarder
 ENV APP_SOCKET="/run/hub/app.sock"
 ENV SCRIPT_NAME=""
 
-- 
GitLab