You can use a Vagrant to set up a development environment for Nomad. Vagrant is a tool for building and managing virtual machine environments.
It's often used sorta similar to minikube on the kubernetes side of things, but it can do quite a bit more than just creating a nomad dev setup.
libvirt
Unfortunately, it doesn't support QEMU/kvm out of the box. However,
a plugin vagrant-libvirt exists to add support.\
On void I needed to install some packages first:
xi libxml2-devel libvirt-devel ruby-devel gcc
Then install the plugin:
vagrant plugin install vagrant-libvirt
Finally, create your virtual machine with:
vagrant up --provider=libvirt
NOTE: You might need to modify your Vagrantfile slightly to support libvirt.
While following the nomad tutorial I needed to change this following line:
config.vm.box = "bento/ubuntu-18.04" # 18.04 LTS
to
config.vm.box = "generic/ubuntu1804" # 18.04 LTS\
You can find a list of images online that support libvirt:
https://app.vagrantup.com/boxes/search?provider=libvirt
connect
vagrant ssh
running script without root
You can use privileged: false to create a script that runs as the normal
vagrant user rather than root.
Vagrant.configure("2") do |config|
$script = <<-SCRIPT
rbenv install 2.0.0-p353
rbenv global 2.0.0-p353
gem update --system
yes | gem update
gem install rdoc
gem install rails pg
SCRIPT
config.vm.provision "shell", inline: $script, privileged: false
end