diff --git a/templates/docker_image_jobs.gitlab-ci.yml b/templates/docker_image_jobs.gitlab-ci.yml
index c7c56ed35b7fbd02fc9e3ed5e78c8f02fdbd9a28..65e17d53feaaa0468a4b1672052628a0e763a166 100644
--- a/templates/docker_image_jobs.gitlab-ci.yml
+++ b/templates/docker_image_jobs.gitlab-ci.yml
@@ -42,7 +42,9 @@ include:
     DOCKER_HUB_USER: $DOCKER_HUB_USER
     DOCKER_HUB_PASSWORD: $DOCKER_HUB_PASSWORD
   before_script:
-    - echo "Disabled the default before_script from image builder job template"
+    - |
+      echo "Disabled Git directory permission check"
+      git config --global --add safe.directory '*'
   rules:
     - if: '$CI_COMMIT_TAG && $CI_COMMIT_REF_PROTECTED == "true"'
       when: manual