John Siu Blog

Tech - Business Tool, Personal Toys

Alpine Docker-Machine KVM Driver

☰ Table of Content

It is easy to install Docker in Alpine as packages are readily available. But what about Docker-Machine without VirtualBox?


Install Docker Machine

Following official instruction work perfectly:

1
2
3
base=https://github.com/docker/machine/releases/download/v0.16.0 &&
curl -L $base/docker-machine-$(uname -s)-$(uname -m) >/tmp/docker-machine &&
sudo install /tmp/docker-machine /usr/local/bin/docker-machine

Check version:

1
2
$ docker-machine version
docker-machine version 0.16.0, build 702c267f

Docker KVM Driver

Docker site only give VirtualBox example:

1
docker-machine create --driver virtualbox myvm

There is a driver list if you dig deeper but none is for KVM. dhiltgen on github created one but stopped maintaining it, and it has issue1 with the latest docker image used by docker machine. The current working driver is from tdilauro’s fork and you can install it as below:

1
2
3
curl -L https://github.com/tdilauro/docker-machine-kvm/releases/download/v0.10.1/docker-machine-driver-kvm-alpine3.4 > /usr/local/bin/docker-machine-driver-kvm

chmod +x /usr/local/bin/docker-machine-driver-kvm

This fork added the --kvm-nic-type option to allow one to specify virtio during the creation process. Then you can create docker machine like this:

1
docker-machine create --driver kvm --kvm-nic-type virtio myKvm

John Siu

Update: 2022-05-12
comments powered by Disqus