
我不知道發生了什麼,但直到上週,我已經能夠在基於容器的 Windows 容器中透過基於 SSH 的 URI 克隆 git 儲存庫dotnet-framework-docker
。現在,突然沒有警告,當我去克隆 - 即使是公共存儲庫時,我收到此錯誤:
C:\>git clone [email protected]:atrauzzi/praxis.git
git clone [email protected]:atrauzzi/praxis.git
Cloning into 'praxis'...
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
這是一個Dockerfile
可用於重現問題的簡單方法:
FROM microsoft/dotnet-framework
SHELL ["powershell"]
# Install Git
RUN New-Item -ItemType Directory -Force -Path 'c:/git';
RUN Invoke-WebRequest "https://github.com/git-for-windows/git/releases/download/v2.15.1.windows.1/Git-2.15.1-64-bit.exe" -OutFile "/git-installer.exe" -UseBasicParsing;
RUN Start-Process -FilePath C:/git-installer.exe -ArgumentList '/VERYSILENT', '/NORESTART', '/NOCANCEL', '/SP-', '/DIR="c:/git"' -PassThru | Wait-Process;
RUN rm /git-installer.exe;
我目前不確定是什麼原因造成的。唯一可疑的是,如果我嘗試執行 mingw based ssh.exe
,它會列印一個空白行,然後退出。
我的一些懷疑顯然是關於 mingw 以及我在容器中運行東西的事實。
副本https://github.com/Microsoft/dotnet-framework-docker/issues/61
答案1
這只是一個猜測 - 但我懷疑 dotnet 框架鏡像曾經已經擁有 GitHub 的 SSH 密鑰......這就是說調查https://github.com/git-for-windows/git/issues/1403作為根/理想修復。