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 ?

  • Docker user permission while mounting a directory
  • Bad substitution [duplicate]
  • Map ports so you can access docker running apps from OSX host
  • .Net Core Web Api to Docker Container Mac
  • Tomcat not running on docker image
  • Connecting to postgres from a docker container
  • Monitoring Glassfish 4 on Docker with JVisualVM
  • Access volume in docker build
  • CLion in docker container not finding clang after install
  • How to build docker images with volumes for production
  • Transforming Web.Config in a Windows Docker container
  • How to run a python-flask container on Mac OS?
  • 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 (

    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.