Skip to content

Instantly share code, notes, and snippets.

@friend0
Created March 24, 2017 19:03
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save friend0/084b4a772827430e4f8a21f42badca63 to your computer and use it in GitHub Desktop.
Save friend0/084b4a772827430e4f8a21f42badca63 to your computer and use it in GitHub Desktop.
Install xhyve driver for docker using macports
# If you've installed docker toolbox stuff previously, not macports. Else, you can skip.
sh -c "$(curl -fsSl https://raw.githubusercontent.com/docker/toolbox/master/osx/uninstall.sh)"
sudo port install docker docker-machine docker-compose
# Install go, qcow-format for qcow2 disk image format
$ sudo port install go opam libev
$ export GO15VENDOREXPERIMENT=1
# Fetch the driver source
$ go get -u -d github.com/zchee/docker-machine-driver-xhyve
$ cd ~/go/src/github.com/zchee/docker-machine-driver-xhyve
$ opam init
$ eval `opam config env`
$ opam install uri qcow-format conf-libev
# Install docker-machine-driver-xhyve binary into /usr/local/bin
$ make install
# docker-machine-driver-xhyve need root owner and uid
$ sudo chown root:wheel /usr/local/bin/docker-machine-driver-xhyve
$ sudo chmod u+s /usr/local/bin/docker-machine-driver-xhyve
@friend0
Copy link
Author

friend0 commented Mar 24, 2017

For macports users

@tsjk
Copy link

tsjk commented Apr 13, 2020

On a more recent system at the time of writing I needed to exchange line 13 to:
$ opam switch create 4.05.0 && opam init --compiler=4.05.0

@jmissig
Copy link

jmissig commented Oct 7, 2021

I’ve not been able to fully build this yet, but on more contemporary versions of Go, I had to do this before line 10 to get src folder:
export GO111MODULE="auto"

@jmissig
Copy link

jmissig commented Oct 7, 2021

Ok and then based on some issues with compiling hyperkit, I figured out to install uri.3.1.0 and make sure angstrom and bigstringaf were not installed.

Also, need to get the local Makefile to see the MacPorts-installed version of libev.a.

And finally, it looks like xhyve needs to be installed for this to work at all.
sudo port install xhyve
Which makes sense, but I don’t think it’s explicitly required anywhere.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment