Vagrant: Provisioning

Provisioning a VM with your Vagrantfile.

e.g. to install dockercreate a file :

It’s a little convoluted. Why didn’t I use `config.vm.provision “docker”`? ‘cos it didn’t work for me:

#!/usr/bin/env bash

apt-get update
apt-get install -y docker-ce

Note: don’t use apt-get install -y docker as this installs the System tray! and

and add it to your Vagrantfile, e.g.:

Vagrant.configure('2') do |config| = "hashicorp/precise64"
    config.vm.define "vm2"
    config.vm.hostname = "vm2"
    config.vm.provision :shell, path: ""

and force Vagrant to reprovision with:

vagrant reload --provision

Leave a Reply

Your email address will not be published. Required fields are marked *