Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Vagrant + Docker

7,295 views

Published on

Vagrant + Docker - Building portable environments

Vagrant
Provisioning Tools for Dev, Production & Test Environments
www.vagrantup.com
GitHub mitchellh/vagrant
Twitter @vagrantup @mitchellh

Docker
Open-Source Container for Dummies
www.docker.io
GitHub dotcloud/docker
Twitter @docker

Published in: Technology
  • DOWNLOAD FULL BOOKS, INTO AVAILABLE FORMAT ......................................................................................................................... ......................................................................................................................... 1.DOWNLOAD FULL. PDF EBOOK here { https://tinyurl.com/y3nhqquc } ......................................................................................................................... 1.DOWNLOAD FULL. EPUB Ebook here { https://tinyurl.com/y3nhqquc } ......................................................................................................................... 1.DOWNLOAD FULL. doc Ebook here { https://tinyurl.com/y3nhqquc } ......................................................................................................................... 1.DOWNLOAD FULL. PDF EBOOK here { https://tinyurl.com/y3nhqquc } ......................................................................................................................... 1.DOWNLOAD FULL. EPUB Ebook here { https://tinyurl.com/y3nhqquc } ......................................................................................................................... 1.DOWNLOAD FULL. doc Ebook here { https://tinyurl.com/y3nhqquc } ......................................................................................................................... ......................................................................................................................... ......................................................................................................................... .............. Browse by Genre Available eBooks ......................................................................................................................... Art, Biography, Business, Chick Lit, Children's, Christian, Classics, Comics, Contemporary, Cookbooks, Crime, Ebooks, Fantasy, Fiction, Graphic Novels, Historical Fiction, History, Horror, Humor And Comedy, Manga, Memoir, Music, Mystery, Non Fiction, Paranormal, Philosophy, Poetry, Psychology, Religion, Romance, Science, Science Fiction, Self Help, Suspense, Spirituality, Sports, Thriller, Travel, Young Adult,
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • @undefined Thank you very much!
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • Hi Michael! Thank you! if helps, take it. ;)
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • Hello David!
    Really nice presentation. Would you mind taking some of your slides for a docker meetup in Athens,Greece?
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here

Vagrant + Docker

  1. 1. Vagrant + Docker building portable environments David Giordano @3dgiordano
  2. 2. Introduction • What is Vagrant? • Created by Mitchell Hasimoto • Provisioning Tools for Dev, Production & Test Environments • Syntactic sugar around VMs and Containers • Syntactic sugar around provisioning • Why use Vagrant? • Quick • Easily replicate production on a Dev box • Easily go production from a Dev box • Mature, stable, proven
  3. 3. Step 1: Install Vagrant • http://www.vagrantup.com/downloads.html • Mac OSX • Windows • Debian/Ubuntu • CentosOS/Redhat/Fedora
  4. 4. Step 2: Project Setup $ mkdir vagrant_getting_started $ cd vagrant_getting_started $ vagrant init
  5. 5. Step 3: Select a Box • http://www.vagrantbox.es • Ubuntu, OpenSuse, OpenBSD, CentOS, Debian.. • Select Provider (VM or Container)
  6. 6. Step 4: Show/Edit Vagrantfile VAGRANTFILE_API_VERSION = "2" Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| config.vm.box = “precise64“ config.vb.box_url = “http://bit.ly/1gLmNF0” end
  7. 7. Step 5: Up! $ vagrant up Step 6: Connect! $ vagrant ssh
  8. 8. Success!!
  9. 9. More Commands • status : status of the machine • halt : stop machine • suspend : suspend machine • reload : restar machine (load new vagrantfile) • resume : resume suspended machine • provision : force provisionning machine • destroy : stop and delete machine • box : manages boxes • …
  10. 10. More Providers (native or plugin) • VMs: • VirtualBox, KVM, Hyper-V, VMware, libvirt • Containers: • lxc, docker • Services: • AWS, DigitalOcean, HP Cloud, Joyent, Rackspace, OpenStack, CloudStack, vSphere…
  11. 11. Customize • config.vm.box* : Box information • config.vm.network* : Network • config.ssh* : SSH connection • config.vm.synced_folder : Share folder • config.vm.provider* : Custom provider settings • config.vm.provision* : Provisioning (Puppet, Chef, Docker, Shell…)
  12. 12. Provisioning? • Automatically install software, alter configuration and more • Shell Scripts • File • Puppet (Standalone & Agent) • Chef (Solo & Client) • Ansible • Salt • Docker!!!
  13. 13. • Open-Source Container for Dummies • Create lightweight, portable, self-sufficient container from any app. • Build once… run anywhere • Configure once… run anything • Ecosystems! OS, VM’s, PaaS, IaaS… • Base: LXC, OpenVZ, systemd-nspawn, libvirt-lxc, libvirt-sandbox, qemu/kvm, Jails, Solaris Zones, chroot (0.9*)
  14. 14. Vagrant and Docker • BOX = Machine • Docker = Container (App package inside the Box) • Functions: Pull, Build, Run • Allow others provisioning (Shell, puppet, chef)
  15. 15. Docker in Vagrantfile Vagrant.configure("2") do |config| v = config.vm v.box = "precise64" v.box_url = "http://bit.ly/1gLmNF0" v.network "forwarded_port", guest: 5000, host: 9292 v.provision "docker", images: [“dg/docker-sample"] v.provision “docker“ do |d| d.run “dg/docker-sample”, args: "-p 5000:5000“ end end
  16. 16. Up! $ vagrant up Connect!
  17. 17. Success!!
  18. 18. Want to learn more? • www.vagrantup.com • GitHub mitchellh/vagrant • Twitter @vagrantup @mitchellh • www.docker.io • GitHub dotcloud/docker • Twitter @docker

×