Add Dockerfile

This commit is contained in:
Jérémy WALTHER
2019-12-12 19:09:56 +01:00
parent dc72babb20
commit 27edcf0f7a
2 changed files with 34 additions and 0 deletions

27
Dockerfile Normal file
View File

@@ -0,0 +1,27 @@
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
ENTRYPOINT [ "/usr/local/bin/docker-entrypoint" ]
CMD [ "/usr/bin/git", "quick-stats" ]

View File

@@ -206,6 +206,13 @@ If you are installing with Cygwin, use these scripts:
If you are wishing to use this with WSL, follow the UNIX and Linux instructions.
### Docker
You can use the Docker image provided:
* Build: `docker build -t arzzen/git-quick-stats .`
* Run interactive menu: `docker run --rm -it -v $(pwd):/git arzzen/git-quick-stats`
## System requirements
* An OS with a Bash shell