A useful simple cross platform git container running in alpine Linux
940
Cross platform version of alpine-git image from https://github.com/alpine-docker/git
A useful simple git container running in alpine Linux, especially for tiny Linux distro, such as RancherOS, which doesn't have a package manager.
This feature was added on 23th May 2021.
--platform linux/amd64,linux/arm/v7,linux/arm64/v8,linux/arm/v6,linux/ppc64le,linux/s390x)amd64, because I have no other environment to do that. If you have any issues with other arch, you need raise PR to fix it.docker pull , docker run command with other arch, you can run it as normal. For example, if you need pull image from arm (such as new Mac M1 chip), you can run docker pull alpine/git:v2.30.2 to get the image directly.https://github.com/alpine-docker/git
https://hub.docker.com/r/nedaya/alpine-git/tags/
Notes:
New tags with non-root user in image has been created.
alpine/git:<version>-user
alpine/git:user
Its uid and gid in container are 1000
$ docker run -ti --rm --entrypoint=id alpine/git:user
uid=1000(git-user) gid=1000(git-user)
Docker build from feature branch feature/non-root
docker run -ti --rm -v ${HOME}:/root -v $(pwd):/git alpine/git <git_command>
For example, if you need clone this repository, you can run
docker run -ti --rm -v ${HOME}:/root -v $(pwd):/git alpine/git clone https://github.com/alpine-docker/git.git
To save your type, add this fuction to ~/.bashrc or ~/.profile
$ cat ~/.profile
...
function git () {
(docker run -ti --rm -v ${HOME}:/root -v $(pwd):/git alpine/git "$@")
}
...
$ 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/alpine-docker/git.git
alias git="docker run -ti --rm -v $(pwd):/git -v $HOME/.ssh:/root/.ssh alpine/git"
$ cd application
$ alias git="docker run -ti --rm -v $(pwd):/git -v $HOME/.ssh:/root/.ssh alpine/git"
$ git clone [email protected]:YOUR_ACCOUNT/YOUR_REPO.git
$ cd YOUR_REPO
$ alias git="docker run -ti --rm -v $(pwd):/git -v $HOME/.ssh:/root/.ssh alpine/git"
# edit several files
$ git add .
$ git status
$ git commit -m "test"
$ git push -u origin master
steps:
- name: submodules
image: nedaya/alpine-git
commands:
- git submodule update --init --recursive --remote
Supports git, http/https and ssh protocols.
Refer: Git on the Server - The Protocols
Set Travis CI to run builds every month.
v${GIT_VERSION})latest tag for this imageContent type
Image
Digest
sha256:eed749334…
Size
18.4 MB
Last updated
about 4 years ago
docker pull nedaya/alpine-git