-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for Windows #4
Comments
I forked and updated I also added https transport so that it can be tested against Docker Toolbox on Windows, but I doubt it will work since attach fails with Docker Toolbox on OSX. |
Here is how to test Nut with Docker for Windows, on Windows 10:Move to branch supportwindows # Build Nut for Windows, in a container
docker run -i -t --rm -v $PWD:/go/src/github.com/matthieudelaro/nut -w /go/src/github.com/matthieudelaro/nut golang:1.6 env GOOS=windows GOARCH=amd64 go build -o nut Expected bugs:
Here is how to test Nut with Docker Toolbox, on Windows:Move to branch supportwindows # Build Nut for Windows, in a container
docker run -i -t --rm -v $PWD:/go/src/github.com/matthieudelaro/nut -w /go/src/github.com/matthieudelaro/nut golang:1.6 env GOOS=windows GOARCH=amd64 go build -o nut Nut should be able to connect to Docker daemon using Docker Machine variables, pull images automatically, and start container. But:
Fix filepathI think that a fix is to create some Fix attachFirst make sure where the issues comes from. I think it comes from fsouza/go-dockerclient#126 (Nut uses this library to connect to Docker Daemon). If so, then good fix is to help fix go-dockerclient. |
The source code of |
Nut compiles and partially runs on Windows! Since Nut supports Docker Toolbox on OSX, it also got closer to supporting Docker Toolbox on Windows. What works
What fails
(tested on Docker Toolbox, Windows 7) Branch
|
I'm able to compile it on Windows using the master branch. Using PowerShell, I adjusted the above command by using docker run -i -t --rm -v ${PWD}:/go/src/github.com/matthieudelaro/nut -w /go/src/github.com/matthieudelaro/nut golang:1.6 env GOOS=windows GOARCH=amd64 go build -o nut.exe
That looks good. However, trying out this throws an error: PS C:\Users\cameron\go\src\github.com\matthieudelaro\nut> .\nut.exe --exec="echo hello world"
Could not inspect image golang:1.6 : Get http://unix.sock/images/golang:1.6/json: dial unix /var/run/docker.sock: socket: An a
ddress incompatible with the requested protocol was used.
Pulling image...
time="2016-05-17T11:58:43-07:00" level=error msg="Could not pull image golang:1.6: dial unix /var/run/docker.sock: socket: An
address incompatible with the requested protocol was used." I have the latest Docker for Windows 1.11.1-beta11 installed. |
Thanks for the test with Docker for Windows! I assume that you don't get this issue with Docker Toolbox, right? It looks like it comes from here : https://github.com/matthieudelaro/nut/blob/master/network.go#L44 However, according to this post, on Windows we can mount docker socket, just like on linux, with On OSX, when Docker for Mac is off, I get this error message:
"incompatible with the requested protocol"... Maybe removing |
anyone with windows and node installed willing to try this command to see if it works?
haven't tested it on windows yet it should automatically put a pre-build binary of |
@RnbWd : I tried npm on Windows 10, which encounters issues in the installation process: I also tried to compile and run nut on Windows 10, with Docker Toolbox: With Git BashThe first issue in Git Bash on my installation is that With Command Prompt
|
oh, there's ways to normalize the paths between linux / windows, and I always see windows files ending in
It's using the default
so I can rename the file? or maybe it's a global npm permission thing? I assume it needs |
I don't know either :( |
I'll assume yes... - but i'll start up a windows vm (or maybe window IOT for raspi) - or just try building it instead of linking a binary. I'm certain this is possible |
Ok. It's not trivial to get a VM which can do emulation, so I created a Windows 10 VM in Virtual Box, which connects to the docker VM (both VM are running on the same host). Here is the recipe to connect them: prepare VMs
copy-paste certificates from osx to windows
set docker machine environment variables
test docker
NoteIn case of error "cannot enable tty mode on non tty input", see docker-archive/toolbox#136 If you need to troubleshoot the connection: Windows 10 VM won't answer ping from Docker VM, but Docker VM answers ping from Windows 10 VM. If this works properly for you as well, I may write a blog post for this, or add it to the wiki for contributors. |
Okay I'll try this out - and my roommate has a windows machine too.. not sure if I can use the same code to get docker native but if virtual machine doesn't work I'll try his computer. (at my last job, we had to use windows for a printer driver, and our VM's were faster than the 'cheap windows laptop' we tried using initially. - the bindings for docker could be weird? But I know that the npm binary installation works (I relied on that heavily in the past) edit: formatted with |
Not sure it answers your question, but my recipe doesn't make use of Docker for Windows. It uses Docker Toolbox. |
#4) On unix, nut uses docker api to connect to docker host. But one can ask nut to call docker cli by using the flag --dockercli. On Windows, docker cli is used by default. But one can revert to docker api using flag --dockerapi
TL;DR: Nut v0.1.3 supports Windows 🎉Here is a call to DetailsSo far Nut used to call docker api directly, without using docker cli at all. Now there is a flag I tested this in CMD on Windows 10, in a VM reaching another VM running boot2docker. I had issues in Git Bash (due to an issue of docker toolbox in this environment, under some circumstances: docker-archive/toolbox#136) @RnbWd : I updated the manual build. For Windows, there are both |
sorry i was out of town I'll update it and test it on my roommates windows machine as well |
Are GUI applications not supported on Windows yet? There's a workflow for running containerized GUI apps on Windows 10 that goes like this:
I have a bunch of scripts for this in my profile, but I was hoping there's some nice tool that encapsulates this stuff. |
Hello @masaeedu , You're right, it's not implemented yet. This feature is implemented for OSX and for other unix systems in platform depend files. The OSX version implements a workflow similar to the one you describe, in just a few lines. As for windows version, I never had the chance to dev Nut on a proper Windows installation, but I'm pretty sure that you could implement it quickly, using the other versions as an example. I think that this section of the wiki will help you. Hoping to see your PR soon :) |
@matthieudelaro Alright then. What should be the strategy for installing X? Do you just expect it to be on the machine or install it yourself? |
Great :) For OSX, I assumed that it was already installed. But I didn't make any assumption about the configuration of X, so that it should work with any install. So you could do the same, and simply provide instructions to install X on Windows. I don't feel confortable about forcing users to use a specific implementation of X. (However it may be required for you method, and in this case it should be explained in the instructions to use the feature on Windows.) |
Their is one short platform dependent file to implement in module
github.com/fgrehm/go-dockerpty
: term_PLATFORM.goProbably some other modifications, especially when
filepath.Join
is called: since it will be compiled for Windows, but targets container path (linux) half the time, errors are to be expected.The text was updated successfully, but these errors were encountered: