Skip to content
forked from 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.

License

Notifications You must be signed in to change notification settings

dockerimages/git

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 

Repository files navigation

dockerimages/git:alpine

DockerHub Badge

usage

docker run -ti --rm -v ${HOME}:/root -v $(pwd):/git dockerimages/git:alpine <git_command>

For example, if you need clone this repository, you can run

docker run -ti --rm -v ${HOME}:/root -v $(pwd):/git dockerimages/git clone https://github.com/dockerimages/git.git

Optional usage 1:

To save your typeing, add this fuction to ~/.bashrc or ~/.profile

$ cat ~/.profile

...

function git () {
    (docker run -ti --rm -v ${HOME}:${HOME} -v $(pwd):/git dockerimages/git:alpine "$@")
}

...

$ source ~/.profile

for example, if you need clone this repository, with the function you just set, you can run it as local command

git clone https://github.com/dockerimages/git.git

Optional usage 2:

alias git="docker run -ti --rm -v $(pwd):/git -v ${HOME}:${HOME} dockerimages/git:alpine

NOTES:

  • You need redefine (re-run) the alias, when you switch between different repositories
  • You need run above alias command only under git repository's root directory.

About

A useful simple git container running in alpine linux, especially for tiny linux distro, such as RancherOS, which don't have package manager.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Dockerfile 100.0%