Skip to content

Commit 42ae46d

Browse files
committed
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
1 parent 795a526 commit 42ae46d

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

Dockerfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,7 @@ RUN apt update \
206206
&& apt autoremove -y \
207207
&& apt clean
208208

209+
RUN git config --global --add safe.directory '*'
209210

210211
# Build/install static modules that do not have packages
211212
COPY mods-available /mods-available

0 commit comments

Comments
 (0)