Skip to content
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

Embeds xhyve #27

Merged
merged 4 commits into from
Dec 29, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions Godeps/Godeps.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 0 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,19 +30,6 @@ If you were doubt problem either, please post to this repository [issues](https:
> make install
```

### xhyve-bindings
https://github.com/zchee/xhyve-bindings

Separated xhyve Go bindings into [xhyve-bindings](https://github.com/zchee/xhyve-bindings).
Or, see experimental embedded xhyve branch [embed-xhyve](https://github.com/zchee/docker-machine-driver-xhyve/tree/embed-xhyve)

```bash
> go get -d github.com/zchee/xhyve-bindings
> cd $GOPATH/src/github.com/zchee/xhyve-bindings
> make
> make install
```

## Install

Like the docker-machine's `Makefile`, install the `docker-machine-driver-xhyve` binary will be in `/usr/local/bin`.
Expand Down
12 changes: 11 additions & 1 deletion bin/main.go
Original file line number Diff line number Diff line change
@@ -1,10 +1,20 @@
package main

import (
"os"

"github.com/docker/machine/libmachine/drivers/plugin"
goxhyve "github.com/hooklift/xhyve"
"github.com/zchee/docker-machine-driver-xhyve"
)

func main() {
plugin.RegisterDriver(new(xhyve.Driver))
if len(os.Args) >= 2 && os.Args[1] == "xhyve" {
args := os.Args[1:] // Technically we only need 2:, but a bug in hooklift/xhyve requires one arg in the beginning
if err := goxhyve.Run(args, make(chan string)); err != nil {
panic(err)
}
} else {
plugin.RegisterDriver(xhyve.NewDriver("", ""))
}
}
7 changes: 5 additions & 2 deletions mk/driver.mk
Original file line number Diff line number Diff line change
Expand Up @@ -54,12 +54,15 @@ test-upgrade:
test-url:
${DOCKER_MACHINE_CMD} --storage-path ${DOCKER_MACHINE_STORAGEPATH} url ${DOCKER_MACHINE_VM_NAME}

driver-run: clean build install driver-kill
rm -rf ${DOCKER_MACHINE_STORAGEPATH}/machines/${DOCKER_MACHINE_VM_NAME} && ${DOCKER_MACHINE_CMD} --storage-path ${DOCKER_MACHINE_STORAGEPATH} create --driver xhyve --xhyve-disk-size ${DOCKER_MACHINE_VM_DISKSIZE} ${DOCKER_MACHINE_VM_NAME}
driver-run: clean build install driver-remove driver-kill
${DOCKER_MACHINE_CMD} --storage-path ${DOCKER_MACHINE_STORAGEPATH} create --driver xhyve --xhyve-disk-size ${DOCKER_MACHINE_VM_DISKSIZE} ${DOCKER_MACHINE_VM_NAME}

driver-kill:
@PID=$$(pgrep goxhyve) || PID=none; \
echo "${CBLUE}==>${CRESET}${CGREEN}Kill goxhyve test process. PID:$$PID ${CRESET} ..."; \
sudo kill $$PID 2>/dev/null || true

driver-remove:
${DOCKER_MACHINE_CMD} --storage-path ${DOCKER_MACHINE_STORAGEPATH} rm -f ${DOCKER_MACHINE_VM_NAME} || true

.PHONY: driver-kill
3 changes: 3 additions & 0 deletions vendor/github.com/hooklift/xhyve/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions vendor/github.com/hooklift/xhyve/.gitmodules

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

51 changes: 51 additions & 0 deletions vendor/github.com/hooklift/xhyve/CONTRIBUTING.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading