Docker for windows:我应该在哪里将SSH私钥放在一个windows容器中用于git?

我正在使用图像microsoft/windowsservercore创build在Windows 10桌面上运行Docker for Windows的Windows容器。 我已经在这个容器中使用chocolatey这样安装git

 FROM microsoft/windowsservercore # some other steps go here RUN @powershell -NoProfile -ExecutionPolicy Bypass -Command "iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))" && SET "PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin" RUN choco install git -params '"/GitAndUnixToolsOnPath"' -y EXPOSE 8080 # some other steps go here 

Git在容器中安装的很好,如果我像这样打开容器的CMD提示符:

 docker exec -it mycontainer cmd 

我可以访问git命令。 但是,我需要运行git clone ,为此我需要将我的SSH密钥放在某个目录中,以供git否则我将不得不使用https 。 当我使用https ,它会永远停留在cloning repository步骤。 不知道为什么会发生。 我可以从容器中ping bitbucket.org ,并使用https在主机上正常工作。 其他的事情我需要了解的是git在哪里寻找SSH密钥,以便我可以创build一个并复制到该目录?

这可能有帮助

基本上:1.确定git主目录(CLI中的“pwd”命令)2.在那里创build一个.ssh目录(mkdir .ssh)3.打开你的密钥文件,并将其导出到.ssh目录