How to mount private SSH key to Docker for Windows container?

Good day everyone.

I have following dev environment:

  • What is the best practices of using Docker for front end development on OS X and passthrough ENV from host to container
  • Docker instruction in Java Maven project to skip tests
  • Kitematic shows all docker images wrongly
  • Vagrant and Docker provider: Container not loaded, Boot2Docker VM not available with SSH
  • Clone and run laravel application easily
  • npm syscall symlink error -95 when installing node-sass on Docker for Windows
    • Win 10 host
    • Docker for Windows latest
    • php5.6 image running in container via docker-compose

    How can i mount my private SSH key to this container? Or is there any possibility to tunnel Pageant from host machine to container?

    All i want is to run Capifony deploy procedures in my container.

  • Can I build a Docker image to “cache” a yocto/bitbake build?
  • how can I login to docker hub via Vagrant docker provisioner
  • Couchbase PHP SDK in Docker Container
  • Docker v1.12 can not change hostname by env variable $HOSTNAME
  • How to know if a docker container is running in privileged mode
  • Can Kubernetes be used like Docker Compose?
  • One Solution collect form web for “How to mount private SSH key to Docker for Windows container?”

    You could use a volume with -v /c/Users/<user>/.ssh/id_rsa:/<home dir>/.ssh/id_rsa:ro.
    home is ~ of the user e.g. /root, /, /home/<user>. The :ro will make it readonly, so your key will not be overwritten by accident.

    But i think you should create a new key and copy it inside the container while building the image.

    Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.