Skip to content

Commit

Permalink
Set git safe.directory in tool containers
Browse files Browse the repository at this point in the history
Otherwise it hit the "dubious ownership" case.
  • Loading branch information
thockin committed Jun 9, 2024
1 parent 26cca48 commit 243b217
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions _test_tools/httpd/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ RUN htpasswd -b -c /etc/htpasswd testuser testpass

# Callers should mount a directory with git repos here.
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 run.sh /
Expand Down
2 changes: 2 additions & 0 deletions _test_tools/sshd/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ VOLUME /dot_ssh

# Callers should mount a directory with git repos here.
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"
RUN echo "test:x:65533:65533::/home/test:/usr/bin/git-shell" >> /etc/passwd
Expand Down

0 comments on commit 243b217

Please sign in to comment.