From 42ae46d49c2b5d5432a362309e1393536679121d Mon Sep 17 00:00:00 2001 From: Marco Pivetta Date: Tue, 14 Jun 2022 09:54:40 +0200 Subject: [PATCH] Fix: disable `git`'s `safe.directory` handling completely Starting with GIT 2.35.3, GIT disallows operating on directories owned by other users. This is to prevent hooks from taking over the system, but this container is a single-user environment, and hooks are generally not configured on checkout anyway. This container has a different $UID/$GID than the parent worker, which performs `git clone`. With this `git config` change, we ignore this security scenario completely. Ref: https://stackoverflow.com/questions/71849415/i-cannot-add-the-parent-directory-to-safe-directory-in-git/71904131#71904131 --- Dockerfile | 1 + 1 file changed, 1 insertion(+) diff --git a/Dockerfile b/Dockerfile index 475094f..c59d692 100644 --- a/Dockerfile +++ b/Dockerfile @@ -206,6 +206,7 @@ RUN apt update \ && apt autoremove -y \ && apt clean +RUN git config --global --add safe.directory '*' # Build/install static modules that do not have packages COPY mods-available /mods-available