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 ?

  • How to install local packages using pip as part of a docker build?
  • docker: Is it possible to start native windows sibling containers from within another?
  • Docker bash'ing with find
  • Fail when start a new container with elasticsearch 5.0
  • architechtetural thoughts about dockerizing the exsting services
  • Why does docker compose exit right after starting?
  • How to connect Emacs' Elpy in-buffer python interpreter to docker container?
  • Run multiple containers on same docker network localhost
  • aws cli cannot read from dynamodb docker container
  • Scripting Docker, Not Connected After Running Script?
  • How to share local files to docker container In swarm with docker-compose
  • application configuration as a docker image
  • 2 Solutions collect form web for “git clone project from inside docker container”

    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/)

    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 …
    
    Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.