Set git `safe.directory` in tool containers

Otherwise it hit the "dubious ownership" case.
This commit is contained in:
Tim Hockin 2024-06-09 00:34:26 -07:00
parent b5b0558d58
commit 750e20e6da
2 changed files with 4 additions and 0 deletions

View File

@ -42,6 +42,8 @@ RUN htpasswd -b -c /etc/htpasswd testuser testpass
# Callers should mount a directory with git repos here. # Callers should mount a directory with git repos here.
VOLUME /git VOLUME /git
# sshd runs as root, and the repo directory might be owned by anyone.
RUN git config --system safe.directory '*'
COPY nginx.conf /etc/nginx/ COPY nginx.conf /etc/nginx/
COPY run.sh / COPY run.sh /

View File

@ -49,6 +49,8 @@ VOLUME /dot_ssh
# Callers should mount a directory with git repos here. # Callers should mount a directory with git repos here.
VOLUME /git VOLUME /git
# sshd runs as root, and the repo directory might be owned by anyone.
RUN git config --system safe.directory '*'
# Callers can SSH as user "test" # Callers can SSH as user "test"
RUN echo "test:x:65533:65533::/home/test:/usr/bin/git-shell" >> /etc/passwd RUN echo "test:x:65533:65533::/home/test:/usr/bin/git-shell" >> /etc/passwd