Skip to content

Commit 750e20e

Browse files
committed
Set git safe.directory in tool containers
Otherwise it hit the "dubious ownership" case.
1 parent b5b0558 commit 750e20e

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

_test_tools/httpd/Dockerfile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,8 @@ RUN htpasswd -b -c /etc/htpasswd testuser testpass
4242

4343
# Callers should mount a directory with git repos here.
4444
VOLUME /git
45+
# sshd runs as root, and the repo directory might be owned by anyone.
46+
RUN git config --system safe.directory '*'
4547

4648
COPY nginx.conf /etc/nginx/
4749
COPY run.sh /

_test_tools/sshd/Dockerfile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,8 @@ VOLUME /dot_ssh
4949

5050
# Callers should mount a directory with git repos here.
5151
VOLUME /git
52+
# sshd runs as root, and the repo directory might be owned by anyone.
53+
RUN git config --system safe.directory '*'
5254

5355
# Callers can SSH as user "test"
5456
RUN echo "test:x:65533:65533::/home/test:/usr/bin/git-shell" >> /etc/passwd

0 commit comments

Comments
 (0)