An Introduction to Vagrant
and Docker
Scott Lowe
http://blog.scottlowe.org
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
What is Vagrant?
☞ A CLI-based tool for streamlining the use of VM environments
(creation, provisioning, usage, & decommissioning)
☞ Available from http://www.vagrantup.com
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)
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
What are the components of
Vagrant?
Vagrant
☞ Written in Ruby
☞ Multi-platform (Windows, Linux, OS X)
☞ CLI (no GUI)
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
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
Vagrantfile
☞ A text file (written with Ruby syntax) that describes the VM
environment
Vagrant demo time!
What is Docker?
☞ A CLI tool for simplifying the use of Linux containers
☞ Available from https://www.docker.com
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
Use cases for Docker
☞ Rapidly deploy (or un-deploy) containers
☞ Simplify the creation of custom container images
☞ Make sharing container images very easy
What are the components of
Docker?
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)
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)
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
Dockerfile
☞ A simple text file describing a Docker image
Docker demo time!
Docker + Vagrant = ?
Q&A
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

An Introduction to Vagrant and Docker

  • 1.
    An Introduction toVagrant and Docker Scott Lowe http://blog.scottlowe.org
  • 2.
    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
  • 4.
    What is Vagrant? ☞A CLI-based tool for streamlining the use of VM environments (creation, provisioning, usage, & decommissioning) ☞ Available from http://www.vagrantup.com
  • 5.
    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)
  • 6.
    Use cases forVagrant ☞ 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
  • 7.
    What are thecomponents of Vagrant?
  • 8.
    Vagrant ☞ Written inRuby ☞ Multi-platform (Windows, Linux, OS X) ☞ CLI (no GUI)
  • 9.
    Vagrant provider ☞ Interfaceswith 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
  • 10.
    Vagrant box ☞ Templateused when creating VM environments in Vagrant ☞ Boxes are provider-specific ☞ Packer is a related product that can be used to help build Vagrant boxes
  • 11.
    Vagrantfile ☞ A textfile (written with Ruby syntax) that describes the VM environment
  • 12.
  • 14.
    What is Docker? ☞A CLI tool for simplifying the use of Linux containers ☞ Available from https://www.docker.com
  • 15.
    What are Linuxcontainers? ☞ 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
  • 16.
    Use cases forDocker ☞ Rapidly deploy (or un-deploy) containers ☞ Simplify the creation of custom container images ☞ Make sharing container images very easy
  • 17.
    What are thecomponents of Docker?
  • 18.
    Docker daemon ☞ Responsiblefor 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)
  • 19.
    Docker client ☞ CLIclient 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)
  • 20.
    Docker image ☞ Thecontents 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
  • 21.
    Dockerfile ☞ A simpletext file describing a Docker image
  • 22.
  • 23.
  • 25.
  • 26.
    Thank you! Be sureto 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