我正在使用该映像microsoft/windowsservercore
创建一个在 Docker 上运行的 Windows 容器,用于 Windows 10 桌面上的 Windows。我已经安装git
在这个容器中,使用chocolatey
如下:
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
永远卡在 step 上。不知道为什么会这样。我可以bitbucket.org
从容器 ping 并git clone
使用https
. 我需要了解的另一件事是在哪里git
寻找 SSH 密钥以便我可以创建一个并复制到该目录?