Git project cloning from an internal docker container

In my development machine, I run several docker containers. My development machine has authorized keys. Is there a way to make a Git clone of a project from the internal docker container using ssh host keys?

+3
source share
2 answers

You can copy your keys to the docker container using the SCP command or using the shared folder functions ( http://docs.docker.io/en/latest/use/working_with_volumes/ )

+3
source

If you use an SSH agent, you can also bind-install the SSH agent socket inside the container, for example:

docker run -v $SSH_AUTH_SOCK:/auth.sock -e SSH_AUTH_SOCK=/auth.sock myimage …
+6
source

All Articles