machine-drivers / docker-machine-driver-xhyve

docker-machine/minikube/minishift driver plugin for xhyve/hyperkit (native macOS hypervisor.framework)
https://godoc.org/github.com/machine-drivers/docker-machine-driver-xhyve
BSD 3-Clause "New" or "Revised" License
889 stars 73 forks source link

make docker-machine-driver-xhyve go gettable #49

Closed saljam closed 8 years ago

saljam commented 8 years ago

Building with the makefile might be useful for development, but you don't always need one for Go and being able to install the driver binary by just running:

go get github.com/zchee/docker-machine-driver-xhyve

makes it easier to get started and is more idiomatic Go.

saljam commented 8 years ago

I propose we do that by moving the go files in the root directory into a directory of their own called "xhyve" (to match the package name) and moving bin/main.go to the root. (Or to cmd/docker-machine-driver-xhyve similar to how golang.org/x/tools does it for example.)

What do you think? Would this break the build in any way I've not anticipated?

zchee commented 8 years ago

@saljam Thanks issue!

I was inspired by your comments(It's not that the folder structure), I have testing it now. I will reply later.

zchee commented 8 years ago

@saljam I think so, too. The reason is that the first docker-machine driver sample repository was that folder structure. As you have proposed, I think,

Same as https://github.com/saljam/docker-machine-driver-xhyve/commit/9967bae0cd7a796bdcd528b898b6bff1ac981be3.

However, in a typical docker-machine driver will be complete in it, but docker-machine-driver-xhyve binary need owner to root:wheel, and set root uid (-rwsr-xr-x root:wheel) hack. The caused by vmnet.framework required sudo. See https://github.com/zchee/docker-machine-driver-xhyve/blob/master/Makefile#L119

So, Folder structure will be clean, but can not full installation only go get for now.

saljam commented 8 years ago

Thanks! And yes, of course, it will still need to be run as root.

zchee commented 8 years ago

Merged https://github.com/zchee/docker-machine-driver-xhyve/pull/53

Close.