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

Good day everyone.

I have following dev environment:

  • Docker usage in compose/swarm mode
  • use inheritance in docker-compose.yml
  • How to build docker image from github repository
  • Docker: How to use selenium server to do nightwatchJS test?
  • How can I use XDebug with a PHP upstream behind an nginx reverse proxy?
  • How could I connect to nginx vhost in Docker container from linked php Docker container?
    • 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.

  • Install Docker on OpenVZ VPS
  • Cannot create container with more than 127 parents
  • Run Go script inside Docker Container or cron job?
  • How do I save kubectl logs to a file on my host machine?
  • How do you include locally-built wheel dependencies in a build?
  • How to set host in nginx configuration running inside docker?
  • 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.