mirror of
https://github.com/git-quick-stats/git-quick-stats.git
synced 2025-12-16 12:00:12 +01:00
When bind-mounting a Git repository to the workdir, Git would complain about 'dubious ownership'. We add an exception to the global Git config, in the way Git tells us to. This should be safe since - we run in a container, and - the user can set the mount to read-only. refs: issue #179
29 lines
839 B
Docker
29 lines
839 B
Docker
FROM alpine
|
|
|
|
# Copy sources
|
|
COPY . /app
|
|
|
|
# Install required packages & build git-quick-stats
|
|
RUN apk add --no-cache bash git make ncurses util-linux \
|
|
&& cd /app \
|
|
&& make install \
|
|
&& rm -rf /app \
|
|
&& apk del --no-cache make \
|
|
&& mkdir -p /usr/local/bin \
|
|
&& echo -en "#!/bin/bash\nset -e\n[[ \"\${1::1}\" == '-' ]] && set -- /usr/bin/git quick-stats \"\$@\"\nexec \"\$@\"" \
|
|
> /usr/local/bin/docker-entrypoint \
|
|
&& chmod +x /usr/local/bin/docker-entrypoint
|
|
|
|
# Declare all variables usables by git-quick-stats
|
|
ENV _GIT_SINCE= \
|
|
_GIT_UNTIL= \
|
|
_GIT_LIMIT= \
|
|
_GIT_PATHSPEC= \
|
|
_MENU_THEME=default \
|
|
TERM=xterm-256color
|
|
|
|
WORKDIR /git
|
|
RUN git config --global --add safe.directory /git
|
|
ENTRYPOINT [ "/usr/local/bin/docker-entrypoint" ]
|
|
CMD [ "/usr/bin/git", "quick-stats" ]
|