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

Good day everyone.

I have following dev environment:

  • Docker: exposed ports cannot be accessed in another container
  • Docker rm blocks concurrent runs
  • Unable to mount a folder on C Drive as Volume
  • Create keyspace automatically inside docker container with cassandra
  • Laravel 5 application can't connect MariaDB engine in docker container
  • Using docker behind a proxy on an EC2 instance
    • 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.

  • PM2 Won't Start Inside Docker
  • PHP5-FPM missing 'clear_env' option in www.conf
  • Cassandra connection idling and timing out
  • Mount Host Directory to Wildfly deployment directory
  • Authorization error with AWS
  • NuGet with Mono on Linux: Error getting response stream
  • 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.