This is a Docker Machine Driver for Bhyve. It is heavily inspired by the xhyve driver, the generic driver and the VirtualBox driver. See also this issue.
You must be running a version of FreeBSD which includes this commit. As of now (2019/08/16), this is only in FreeBSD-CURRENT.
-
Install required packages:
sudogrub2-bhyvednsmasq
-
User running
docker-machinemust have password-lesssudoaccess to the following commands:/sbin/ifconfig/sbin/sysctl/usr/bin/env/usr/bin/fuser/usr/local/sbin/dnsmasq/usr/local/sbin/grub-bhyve/usr/sbin/bhyve/usr/sbin/bhyvectl/usr/sbin/ngctl
echo 'jsmith ALL=(ALL) NOPASSWD: ALL' >> /usr/local/etc/sudoers
- Add user to wheel group:
pw groupmod wheel -m jsmith
- Add these lines to
/etc/devfs.rules:
[system=10]
add path 'nmdm*' mode 0660
-
Set
devfs_system_ruleset="system"in/etc/rc.confand runservice devfs restart -
Add
ng_ether,nmdmandvmmtokld_listin/etc/rc.conf,kldload ng_ether,kldload vmm,kldload nmdm.
make
export MACHINE_DRIVER=bhyve
export PATH=${PATH}:${PWD}
docker-machine create
eval $(docker-machine env)
docker run --rm hello-world
If the interface where the NAT IP is assigned is a member of another bridge, the NAT will fail
Local IPv4 breaks because all inbound traffic is forwarded to the docker-machine VM