Using Docker Git Client

I've got a situation where the git client is not allowed to be installed on the production server (due to strict user policies) but I still want to use git without having to install the git client.

Finally, I found a solution using docker. (For this test I used Docker Desktop on Windows 11).

To clone a repository, just use the instructions below.


  docker run -ti  -v e:\repo\project1:/git alpine/git clone https://gitlab.com/test/project1.git ./

Need to map the volume (on my windows folder) to /git (in docker) and clone the repository to the current folder (./).

Then, git started cloning the repository.

To pull changes :


  docker run -ti --rm -v e:\repo\project1:/git alpine/git pull

0 comments:

 
Copyright © peyotest