machine icon indicating copy to clipboard operation
machine copied to clipboard

Windows : strange behaviour

Open dduportal opened this issue 11 years ago • 10 comments

Running the latest 0.0.2 in Windows results in this beahviour :

C:\Utilisateurs\a503140\Downloads>machine_windows_amd64.exe create -d virtualbox dev
←[31mFATA←[0m[0000] Identity auth public key does not exist at C:\Utilisateurs\a503140\.docker\public-key.json. Please run the docker client without any options to create it.

What seems strange is that code seems to be run inside the machine, and not outside (utils.go) :

cmdString := fmt.Sprintf("mkdir -p %q && cat > %q", authorizedKeysPath, filepath.Join(authorizedKeysPath, "docker-host.json"))
    cmd, err := d.GetSSHCommand(cmdString)

dduportal avatar Dec 10 '14 15:12 dduportal

Well OK, seems related to this : https://github.com/docker/docker/pull/8265 (the docker identity client).

Tried to build the windows client, but ended in errors when running, i'll copy that to the docker PR.

I'm goping to play inside linux VM, and copy the .docker folder with the keys inside in order to conforme to machine needs.

dduportal avatar Dec 10 '14 16:12 dduportal

I built a windows build of https://github.com/docker/docker/pull/8265. It was complaining that it couldn't write .docker/key.json, but it still did. It didn't create public-key.json, so I created it manually from key.json

jeffmendoza avatar Dec 10 '14 18:12 jeffmendoza

After that, machine was working well for me on windows.

jeffmendoza avatar Dec 10 '14 18:12 jeffmendoza

I found the same problem. The path code on Windows is messed up (it sticks "public-" before the "C:" instead of before the "key.json"), and I'm trying to fix it. But if you rename .docker/key.json to .docker/public-key.json it works.

johngossman avatar Dec 10 '14 18:12 johngossman

I figured this out btw...the code is using path.Split, path.Join etc. instead of filepath.Split, filepath.Join. path assumes '/' separators, but Windows of course uses ''. Talk about the gift that keeps on giving...I've been fixing bugs like this in portable code since 1983.

johngossman avatar Dec 10 '14 20:12 johngossman

On my side, same as you, i ran into the same problem with the docker bin compiled. So i just booted up a b2d VM, ssh into, and using the docker binary provided by @bfirsh in the README, calling it one time, and copying the resulting ~/.docker folder in mu %HOME% in Windows. After that, machine stopped to complain about the key, so i could manage to work :)

Thank you !

dduportal avatar Dec 10 '14 20:12 dduportal

Sent dmcgowan a PR: https://github.com/dmcgowan/docker/pull/3

johngossman avatar Dec 10 '14 20:12 johngossman

btw key.json and public-key.json should be different files. The code creates both.

johngossman avatar Dec 10 '14 20:12 johngossman

Hop, PR for that inside machine : https://github.com/docker/machine/pull/83

dduportal avatar Dec 11 '14 17:12 dduportal

https://github.com/docker/machine/pull/83 and https://github.com/docker/machine/pull/93 closed or merged, i can close the current issue.

Thanks for all !

dduportal avatar Dec 22 '14 08:12 dduportal