0
我正在使用圖像microsoft/windowsservercore
在Windows 10桌面上創建一個在Docker for Windows上運行的Windows容器。適用於Windows的Docker:我應該在哪裏將SSH私鑰放入git的windows容器中?
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
我可以訪問我一直在使用chocolatey
這樣安裝在這個容器git
git
命令。但是,我需要運行git clone
,爲此,我需要將我的SSH密鑰放在某個目錄中,以供選擇git
,否則我將不得不使用https
。當我使用https
時,它永遠卡在cloning repository
步驟。不知道爲什麼會發生。我可以從容器中ping bitbucket.org
,git clone
可以在主機上使用https
正常工作。我需要了解的其他事情是git
在哪裏尋找SSH密鑰,以便我可以創建一個並複製到該目錄?
可能重複[克隆私人git回購與dockerfile](http://stackoverflow.com/questions/23391839/clone-private-git-repo-with-dockerfile) – ygesher
不是真的。這個問題是針對Linux容器的,這個是針對Windows容器的。我知道如何使用Linux容器 –