Run git
$ docker build -t 4km3/git .
: "${GIT_WORK_TREE:=/workdir}"
: "${GIT_DIR:=/workdir/.git}"
Go to the git repo working dir, then run the container like this:
$ docker run \
-it \
--rm \
-v $PWD:/workdir \
4km3/git status
For your convenience, a bash function named 'git' is provided in git.bash
:
$ . git.bash
$ git status
...