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 forward eclipse in a docker container through a linux proxy?
  • Spring boot with docker unable to find valid certification path to requested target error
  • How to set up container network by connman in container environment?
  • Jenkins docker missing some binaries
  • Docker: RVM command not found
  • Could not get page inside of the docker's container
  • How to push to AWS EC2 Service Container from a specific git branch (ie 'staging')
  • Uploading/Pushing data to Google Cloud Volume
  • Gearmand Does Not Start - Socket Address Family Not Supported
  • Docker Exits Before Completing Golang Project Build
  • NodeJS: Can't connect to postgreSQL container from another container
  • How to disable Nginx caching when running Nginx using Docker
  • 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.