mashf13
mashf13

Reputation: 43

git clone project from inside docker container

I am running few containers of docker, in my development machine. My development machine has got the authorized keys. Is there a possible way to do Git project clone from inside docker container, by leveraging the host ssh keys ?

Upvotes: 4

Views: 2566

Answers (2)

jpetazzo
jpetazzo

Reputation: 15511

If you use an SSH agent, you can also bind-mount the SSH agent socket within the container, e.g.:

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

Upvotes: 8

ceth
ceth

Reputation: 45325

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

Upvotes: 4

Related Questions