大网数据广告活动
服务器运维问答

Unable to clone ssh-based GIT URIs in a Windows Container

· 52CE 我爱测

Not sure what happened, but up until last week, I've been able to clone git repositories via SSH-based URIs in my Windows containers based on the dotnet-framework-docker container. Now, suddenly without warning, when I go to clon…

问题原文

原帖链接 · Alexander Trauzzi · CC BY-SA 3.0

Not sure what happened, but up until last week, I've been able to clone git repositories via SSH-based URIs in my Windows containers based on the dotnet-framework-docker container. Now, suddenly without warning, when I go to clone - even a public repository, I get this error:

C:\>git clone [email omitted]:atrauzzi/praxis.git
git clone [email omitted]: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.

Here's a simple Dockerfile that can be used to reproduce the issue:

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;

I'm not sure at this point what could be causing this. The only suspicious thing is that if I try to run the mingw based ssh.exe, it prints a blank line and then exits.

Some suspicions I have are obviously around mingw and the fact that I'm running things in a container.

cc https://github.com/Microsoft/dotnet-framework-docker/issues/61

已采纳解答

原帖链接 · Taylor Brown · CC BY-SA 3.0

This is just a guess - but I suspect that the dotnet framework image used to have the SSH key for GitHub already... That said looking into https://github.com/git-for-windows/git/issues/1403 as the root/ideal fix.

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2017-12-12)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 3.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。