An Introduction to Vagrant
and Docker
Scott Lowe
http://blog.scottlowe.org
Slide 2
Slide 2 text
Before we begin
☞ Get involved! Audience participation is requested and
encouraged.
☞ If you use Twitter, feel free to tweet about this session (use
@NashvilleVMUG or hashtag #NashvilleVMUG)
☞ Feel free to take photos or videos of today's session and share
them online
☞ A PDF copy of this presentation will be available online after
the event
Slide 3
Slide 3 text
No content
Slide 4
Slide 4 text
What is Vagrant?
☞ A CLI-based tool for streamlining the use of VM environments
(creation, provisioning, usage, & decommissioning)
☞ Available from http://www.vagrantup.com
Slide 5
Slide 5 text
A "VM environment"?
☞ Think of this as one or more VMs (based on a user-specified
template) along with networking and possible in-guest software
customization
☞ Examples
☞ The classic "3 tier" web/app/DB topology
☞ Trying out new technologies (CoreOS and etcd cluster, Open
vSwitch)
Slide 6
Slide 6 text
Use cases for Vagrant
☞ Sharing VM environments with other users
☞ Accelerating the creation of VM environments
☞ Automating software provisioning inside VM environments
☞ Providing a CLI for creating/destroying/accessing VM
environments
Slide 7
Slide 7 text
What are the components of
Vagrant?
Slide 8
Slide 8 text
Vagrant
☞ Written in Ruby
☞ Multi-platform (Windows, Linux, OS X)
☞ CLI (no GUI)
Slide 9
Slide 9 text
Vagrant provider
☞ Interfaces with back-end virtualization solution
☞ Vagrant comes with a provider for VirtualBox
☞ Provider for VMware desktop products (Fusion & Workstation)
available for a fee
☞ Other providers available as open source projects
☞ See https://github.com/gosddc for examples
Slide 10
Slide 10 text
Vagrant box
☞ Template used when creating VM environments in Vagrant
☞ Boxes are provider-specific
☞ Packer is a related product that can be used to help build
Vagrant boxes
Slide 11
Slide 11 text
Vagrantfile
☞ A text file (written with Ruby syntax) that describes the VM
environment
Slide 12
Slide 12 text
Vagrant demo time!
Slide 13
Slide 13 text
No content
Slide 14
Slide 14 text
What is Docker?
☞ A CLI tool for simplifying the use of Linux containers
☞ Available from https://www.docker.com
Slide 15
Slide 15 text
What are Linux containers?
☞ Linux containers can be thought of as "lightweight
virtualization" or "OS virtualization"
☞ Leverage features built into the Linux kernel (cgroups and
namespaces)
☞ Linux containers have been around for a while, but weren't
very easy to use
Slide 16
Slide 16 text
Use cases for Docker
☞ Rapidly deploy (or un-deploy) containers
☞ Simplify the creation of custom container images
☞ Make sharing container images very easy
Slide 17
Slide 17 text
What are the components of
Docker?
Slide 18
Slide 18 text
Docker daemon
☞ Responsible for spawning containers
☞ As a daemon, it runs in the background
☞ By default, listens on a local Unix socket (can be configured to
listen on a network port)
Slide 19
Slide 19 text
Docker client
☞ CLI client for interacting with the Docker daemon
☞ Can run locally on the same system as the daemon, or remotely
(daemon must be listening on a network port)
Slide 20
Slide 20 text
Docker image
☞ The contents of a Docker container
☞ Comprised of multiple filesystem layers
☞ Stored locally, can be shared via the Docker Hub
☞ Images can be based on other images
Slide 21
Slide 21 text
Dockerfile
☞ A simple text file describing a Docker image
Slide 22
Slide 22 text
Docker demo time!
Slide 23
Slide 23 text
Docker + Vagrant = ?
Slide 24
Slide 24 text
No content
Slide 25
Slide 25 text
Q&A
Slide 26
Slide 26 text
Thank you!
Be sure to provide feedback to the VMUG leaders regarding this
session.
Blog: http://blog.scottlowe.org
Twitter: @scott_lowe
GitHub: https://github.com/lowescott
Life: Colossians 3:17