alpine-docker/git

SSL Internal CA and certificates

gknepper opened this issue · 4 comments

Hi There,

I 'm trying to fing a way to use a internal CA to accept a internal SSL certificate and clone from a https internal git repository?

Thanks

Is this question about this docker image or just common usage of “git”?

If it is second, stackoverflow would be better place to ask for help

Of course about this docker image.
On a normal linux git the procedure is quite straight forward:

git config --global http.sslCAInfo certificate.pem

This is git global setting, which you can set in ~/.gitconfig

In fact, after you run above git command, it will update ~/.gitconfig at your home directly.

So will it be fine to run with

docker run -ti --rm -v ~/.gitconfig:/root/.gitconfig <rest commands>

If you need transfer the certificate into container as well, do the same way:

docker run -ti --rm -v ~/.gitconfig:/root/.gitconfig -v $(pwd)/certificate.pem:/<somewhere in container> <rest commands>

Worked with the following commands:

$ docker run -ti --rm -v ${HOME}:/root -v $(pwd):/git alpine/git config --global http.sslCAInfo certCA.cer
$ docker run -ti --rm -v ${HOME}:/root -v $(pwd):/git alpine/git clone https://your-repo.net/Repo

Thanks