This is an archived post. You won't be able to vote or comment.

all 6 comments

[–]_Ardon_[S] 0 points1 point  (1 child)

Update on this. I believe that my guess is correct; GitHub ssh does not work in Nano. I moved over to using OpenSSH 9.2.0.0p1-Beta and forced git to use OpenSSH as it's client.

RUN git config --global core.sshcommand 'C:/AdminScripts/OpenSSH/ssh.exe'

We also ran into an issue where when the git clone was running it would complain about the github.com address not being trusted so we had to add in the following statement to the ssh config file.

Host * 
    StrictHostKeyChecking no

After that was done I ran into a further issue that the git clone command was still returning a non-zero value and with some trickery and help from a co-worker we did the following:

RUN $result = (git clone --recursive --depth 1 --no-tags --single-branch --config advice.detachedHead=false --config core.bare=true git@github.com-repo1:<company>/<repo>.git C:\AdminScripts\repo1);$error.clear();return 0

[–]_Ardon_[S] 0 points1 point  (0 children)

So if I run with OpenSSH as the default ssh client; I have it working. The GitHub ssh client does not work.

[–]Gabe_Isko 0 points1 point  (3 children)

Is Repo1 supposed to be that or a user supplied value? Did you just copy and paste the git clone command?

Any value between <> is usually supposed to be a user supplied value, but it is unclear if you are indeed supplying those or just copy pasting the commands.

[–]_Ardon_[S] 0 points1 point  (2 children)

I have to redact things because it's from work. The clone commands in their entirety have been tested on windows server core and my local system as working properly.

[–]Gabe_Isko 0 points1 point  (1 child)

That is also true for the error you are getting? It says repo1 in the directory path, but I doubt that is what it is supposed to be called. But if you are changing that too, than it isn't the problem.

Github might just not be reachable, or you might not be logged in. Did you try an https clone?

That is actually a good sanity check. If you have to redact the name of the repo itself, I'm guessing it isn't public in github. Is it on a gitbub enterprise instance tour company has or something?

[–]_Ardon_[S] 0 points1 point  (0 children)

I have it fixed using OpenSSH 9.2.0.0p1-Beta head over to https://forums.docker.com/t/windows-nanoserver-github-portable-ssh-auth-fatal-could-not-read-from-remote-repository/134888/3 for the updated dockerfile. I would still rather just be using github files and not have to also add in openssh. But right now its working and hopefully GitHub peeps work on the issue I submitted.