Is that a Vagrant in your Computer?

Using Vagrant to set up your environment

Slides & Examples:

Slides / Dockerfiles / Vagrantfile


Timothy Lim



Let's start development!

In Theory

  1. Go to website & install requirements
  2. Code
  3. Profit!

Let's start development!

In Reality

  1. Go to website
  2. Try to install requirements
  3. See something breaks
  4. Google Bing the problem
  5. Try to fix it
  6. Go to Step 2


Create and configure reproducible & portable development environments


How-To Use

  1. Install
  2. Download configuration file (i.e. Vagrantfile).
    Manual download or quickstart via command line
    vagrant init hashicorp/precise32
  3. Start the box
    vagrant up
  4. Environment set up perfectly and ready to go

Where does the Vagrant environment live?

Vagrant Terminology

  1. Boxes:
    • base operating system image to create the Vagrant environment from (e.g. .iso file to install an OS)
  2. Vagrantfile:
    • configuration file that creates a Vagrant Environment from a Box
  3. Vagrant Environment:
    • the actual running instance of a environment built from a Box via a Vagrantfile
  4. Providers:
    • where the Vagrant Environment actually runs
    • specified in the Vagrantfile


configuration file



Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| = "hashicorp/precise32"
   config.vm.hostname = "GDGBNdevfest2014" "forwarded_port", guest: 80, host: 8000 "forwarded_port", guest: 8080, host: 8080 "private_network", ip: ""
config.vm.synced_folder "www", "/var/www" config.vm.synced_folder "var_cache_apt", "/var/cache/apt/"
config.vm.provision "shell", :path => "" end

Vagrant Commands

Vagrant Commands

Vagrant Cloud


It's never just a walk in the clouds

And that's Vagrant in a nutshell


But wait, there's more!

Computer Whaling

Using Docker to set up your environment


  • Open platform for developers and sysadmins to build, ship, and run distributed applications.
  • Portable and lightweight (FAST!)
  • Focused more on deployment and production
  • Development solutions exist such as Fig

Docker Terminology

Understanding Docker

Docker Commands (1)

Docker Commands (2)

Docker Commands (3)


Mapping ports

Working Directory

Linking containers

Managing Data in Containers

1. Data Volumes

Managing Data in Containers

2. Data Volume Containers


In conclusion

Dock all the things!

Acknowledgements & Links

  2. Interactive Docker Tutorial
  3. Should I use Vagrant or for creating an isolated environment?
  4. Why You Shouldn’t Use Vagrant: Real talk from a Vagrant burn-out
  5. boot2docker (for OSX and Windows)
  6. Docker Cheat Sheet
  7. Where are Docker Images Stored
  8. Using Docker as a Development Environment
  10. Installing node on Ubuntu

The End

Thanks for your time and enjoy the rest of the event!