For those coming from Google (like me)
another solution is here : GitHub - alpine-docker/git: A useful simple git container running in alpine linux, especially for tiny linux distro, such as RancherOS, which don't have package manager.
$ cat ~/.profile
...
function git () {
(docker run -ti --rm -v ${HOME}:/home/rancher -v $(pwd):/git alpine/git "$@")
}
...
$ source ~/.profile