Vagrant lets us define our desired development environment. It also leverages existing platforms such as VirtualBox and Docker to provision these environments based on how we define them. In this hands-on lab, we use Vagrant alongside LXC to create a simple Vagrantfile that provisions a single Debian host to our specifications.
Learning Objectives
Successfully complete this lab by achieving the following learning objectives:
- Generate the Vagrantfile
Create the
wanderer-app
directory:mkdir wanderer-app
Move into that directory:
cd wanderer-app/
Generate a
Vagrantfile
:vagrant init
- Write the Vagrantfile
Write a simple
Vagrantfile
based on the instructions:# -*- mode: ruby -*- # vi: set ft=ruby : Vagrant.configure("2") do |config| config.vm.box = "fgrehm/wheezy64-lxc" config.vm.box_version = "1.2.0" config.vm.hostname = "wanderer" config.vm.provider "lxc" end
- Test the Vagrantfile
To test the
Vagrantfile
, run:vagrant up