SlideShare uma empresa Scribd logo
1 de 17
Vagrant + Docker
Criando ambientes Portáveis entre plataformas
João Paraná
@joao-parana
@joao.parana
github:
gmail:
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
Step 1: Install Vagrant
• http://www.vagrantup.com/downloads.html
• Mac OSX
• Windows
• Debian/Ubuntu
• CentosOS/Redhat/Fedora
Step 2: Project Setup
$ mkdir vagrant_getting_started
$ cd vagrant_getting_started
$ vagrant init
Step 3: Select a Box
• http://www.vagrantbox.es
• Ubuntu, OpenSuse, OpenBSD, CentOS, Debian..
• Select Provider (VM or Container)
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
Step 5: Up!
$ vagrant up
Step 6: Connect!
$ vagrant ssh
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
• …
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…
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…)
Provisioning?
• Automatically install software, alter configuration and more
• Shell Scripts
• File
• Puppet (Standalone & Agent)
• Chef (Solo & Client)
• Ansible
• Salt
• Docker!!!
• 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*)
Vagrant and Docker
• BOX = Machine
• Docker = Container (App package inside the Box)
• Functions: Pull, Build, Run
• Allow others provisioning (Shell, Puppet, Chef)
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: 8080, host: 9292
v.provision "docker", images: ["parana/web-xe-ubuntu"]
v.provision "docker" do |d|
d.run "parana/web-xe-ubuntu", args: "-p 9292:8080"
end
end
Up!
$ vagrant up
Connect!
YES !!
Want to learn more?
• www.vagrantup.com
• www.docker.io
• GitHub docker
• Twitter @docker

Mais conteúdo relacionado

Mais procurados

Build and deployment
Build and deploymentBuild and deployment
Build and deployment
WO Community
 

Mais procurados (20)

Building with Virtual Development Environments
Building with Virtual Development EnvironmentsBuilding with Virtual Development Environments
Building with Virtual Development Environments
 
Docker Tutorial
Docker TutorialDocker Tutorial
Docker Tutorial
 
Azure VM base images with Packer, Ansble and Vagrant
Azure VM base images with Packer, Ansble and VagrantAzure VM base images with Packer, Ansble and Vagrant
Azure VM base images with Packer, Ansble and Vagrant
 
Vagrant for Virtualized Development
Vagrant for Virtualized DevelopmentVagrant for Virtualized Development
Vagrant for Virtualized Development
 
Build and deployment
Build and deploymentBuild and deployment
Build and deployment
 
Docker Introduction
Docker IntroductionDocker Introduction
Docker Introduction
 
Virtualization for Developers
Virtualization for DevelopersVirtualization for Developers
Virtualization for Developers
 
Introduction to Vagrant
Introduction to VagrantIntroduction to Vagrant
Introduction to Vagrant
 
Building a smarter application stack - service discovery and wiring for Docker
Building a smarter application stack - service discovery and wiring for DockerBuilding a smarter application stack - service discovery and wiring for Docker
Building a smarter application stack - service discovery and wiring for Docker
 
Vagrant
VagrantVagrant
Vagrant
 
Introduction to Ansible
Introduction to AnsibleIntroduction to Ansible
Introduction to Ansible
 
Vagrant
Vagrant Vagrant
Vagrant
 
Dependencies and Licenses
Dependencies and LicensesDependencies and Licenses
Dependencies and Licenses
 
Intro to vagrant
Intro to vagrantIntro to vagrant
Intro to vagrant
 
Webinar - Auto-deploy Puppet Enterprise: Vagrant and Oscar
Webinar - Auto-deploy Puppet Enterprise: Vagrant and OscarWebinar - Auto-deploy Puppet Enterprise: Vagrant and Oscar
Webinar - Auto-deploy Puppet Enterprise: Vagrant and Oscar
 
Testing Ansible with Jenkins and Docker
Testing Ansible with Jenkins and DockerTesting Ansible with Jenkins and Docker
Testing Ansible with Jenkins and Docker
 
Using vagrant
Using vagrantUsing vagrant
Using vagrant
 
What is Docker
What is DockerWhat is Docker
What is Docker
 
Vagrant: The Oscar Plug-in
Vagrant: The Oscar Plug-inVagrant: The Oscar Plug-in
Vagrant: The Oscar Plug-in
 
Automating Docker Containers with Puppet 2014 10-13
Automating Docker Containers with Puppet 2014 10-13Automating Docker Containers with Puppet 2014 10-13
Automating Docker Containers with Puppet 2014 10-13
 

Semelhante a Vagrant & Docker

2 Linux Container and Docker
2 Linux Container and Docker2 Linux Container and Docker
2 Linux Container and Docker
Fabio Fumarola
 
Intro to Docker October 2013
Intro to Docker October 2013Intro to Docker October 2013
Intro to Docker October 2013
Docker, Inc.
 
Intro to Docker November 2013
Intro to Docker November 2013Intro to Docker November 2013
Intro to Docker November 2013
Docker, Inc.
 
Intro Docker october 2013
Intro Docker october 2013Intro Docker october 2013
Intro Docker october 2013
dotCloud
 

Semelhante a Vagrant & Docker (20)

Making Developers Productive with Vagrant, VirtualBox, and Docker
Making Developers Productive with Vagrant, VirtualBox, and DockerMaking Developers Productive with Vagrant, VirtualBox, and Docker
Making Developers Productive with Vagrant, VirtualBox, and Docker
 
Vagrant For DevOps
Vagrant For DevOpsVagrant For DevOps
Vagrant For DevOps
 
2 Linux Container and Docker
2 Linux Container and Docker2 Linux Container and Docker
2 Linux Container and Docker
 
Develop with linux containers and docker
Develop with linux containers and dockerDevelop with linux containers and docker
Develop with linux containers and docker
 
Linux containers and docker
Linux containers and dockerLinux containers and docker
Linux containers and docker
 
Automated Infrastructure and Application Management
Automated Infrastructure and Application ManagementAutomated Infrastructure and Application Management
Automated Infrastructure and Application Management
 
Docker-Hanoi @DKT , Presentation about Docker Ecosystem
Docker-Hanoi @DKT , Presentation about Docker EcosystemDocker-Hanoi @DKT , Presentation about Docker Ecosystem
Docker-Hanoi @DKT , Presentation about Docker Ecosystem
 
OpenStack Summit
OpenStack SummitOpenStack Summit
OpenStack Summit
 
Intro to Docker October 2013
Intro to Docker October 2013Intro to Docker October 2013
Intro to Docker October 2013
 
Intro to Docker November 2013
Intro to Docker November 2013Intro to Docker November 2013
Intro to Docker November 2013
 
Docker introduction
Docker introductionDocker introduction
Docker introduction
 
Introduction to docker
Introduction to dockerIntroduction to docker
Introduction to docker
 
Docker-Intro
Docker-IntroDocker-Intro
Docker-Intro
 
Introduction to Docker
Introduction to DockerIntroduction to Docker
Introduction to Docker
 
Docker Seattle Meetup April 2015 - The Docker Orchestration Ecosystem on Azure
Docker Seattle Meetup April 2015 - The Docker Orchestration Ecosystem on AzureDocker Seattle Meetup April 2015 - The Docker Orchestration Ecosystem on Azure
Docker Seattle Meetup April 2015 - The Docker Orchestration Ecosystem on Azure
 
Containing the world with Docker
Containing the world with DockerContaining the world with Docker
Containing the world with Docker
 
Intro Docker october 2013
Intro Docker october 2013Intro Docker october 2013
Intro Docker october 2013
 
Docker New York Meetup May 2015 - The Docker Orchestration Ecosystem on Azure
Docker New York Meetup May 2015 - The Docker Orchestration Ecosystem on Azure Docker New York Meetup May 2015 - The Docker Orchestration Ecosystem on Azure
Docker New York Meetup May 2015 - The Docker Orchestration Ecosystem on Azure
 
Docker fundamentals
Docker fundamentalsDocker fundamentals
Docker fundamentals
 
How bigtop leveraged docker for build automation and one click hadoop provis...
How bigtop leveraged docker for build automation and  one click hadoop provis...How bigtop leveraged docker for build automation and  one click hadoop provis...
How bigtop leveraged docker for build automation and one click hadoop provis...
 

Último

Top profile Call Girls In Dindigul [ 7014168258 ] Call Me For Genuine Models ...
Top profile Call Girls In Dindigul [ 7014168258 ] Call Me For Genuine Models ...Top profile Call Girls In Dindigul [ 7014168258 ] Call Me For Genuine Models ...
Top profile Call Girls In Dindigul [ 7014168258 ] Call Me For Genuine Models ...
gajnagarg
 
一比一原版(Curtin毕业证书)科廷大学毕业证原件一模一样
一比一原版(Curtin毕业证书)科廷大学毕业证原件一模一样一比一原版(Curtin毕业证书)科廷大学毕业证原件一模一样
一比一原版(Curtin毕业证书)科廷大学毕业证原件一模一样
ayvbos
 
一比一原版(Offer)康考迪亚大学毕业证学位证靠谱定制
一比一原版(Offer)康考迪亚大学毕业证学位证靠谱定制一比一原版(Offer)康考迪亚大学毕业证学位证靠谱定制
一比一原版(Offer)康考迪亚大学毕业证学位证靠谱定制
pxcywzqs
 
一比一原版田纳西大学毕业证如何办理
一比一原版田纳西大学毕业证如何办理一比一原版田纳西大学毕业证如何办理
一比一原版田纳西大学毕业证如何办理
F
 
一比一原版(Flinders毕业证书)弗林德斯大学毕业证原件一模一样
一比一原版(Flinders毕业证书)弗林德斯大学毕业证原件一模一样一比一原版(Flinders毕业证书)弗林德斯大学毕业证原件一模一样
一比一原版(Flinders毕业证书)弗林德斯大学毕业证原件一模一样
ayvbos
 
Abu Dhabi Escorts Service 0508644382 Escorts in Abu Dhabi
Abu Dhabi Escorts Service 0508644382 Escorts in Abu DhabiAbu Dhabi Escorts Service 0508644382 Escorts in Abu Dhabi
Abu Dhabi Escorts Service 0508644382 Escorts in Abu Dhabi
Monica Sydney
 
Russian Call girls in Abu Dhabi 0508644382 Abu Dhabi Call girls
Russian Call girls in Abu Dhabi 0508644382 Abu Dhabi Call girlsRussian Call girls in Abu Dhabi 0508644382 Abu Dhabi Call girls
Russian Call girls in Abu Dhabi 0508644382 Abu Dhabi Call girls
Monica Sydney
 
pdfcoffee.com_business-ethics-q3m7-pdf-free.pdf
pdfcoffee.com_business-ethics-q3m7-pdf-free.pdfpdfcoffee.com_business-ethics-q3m7-pdf-free.pdf
pdfcoffee.com_business-ethics-q3m7-pdf-free.pdf
JOHNBEBONYAP1
 

Último (20)

Vip Firozabad Phone 8250092165 Escorts Service At 6k To 30k Along With Ac Room
Vip Firozabad Phone 8250092165 Escorts Service At 6k To 30k Along With Ac RoomVip Firozabad Phone 8250092165 Escorts Service At 6k To 30k Along With Ac Room
Vip Firozabad Phone 8250092165 Escorts Service At 6k To 30k Along With Ac Room
 
Nagercoil Escorts Service Girl ^ 9332606886, WhatsApp Anytime Nagercoil
Nagercoil Escorts Service Girl ^ 9332606886, WhatsApp Anytime NagercoilNagercoil Escorts Service Girl ^ 9332606886, WhatsApp Anytime Nagercoil
Nagercoil Escorts Service Girl ^ 9332606886, WhatsApp Anytime Nagercoil
 
20240510 QFM016 Irresponsible AI Reading List April 2024.pdf
20240510 QFM016 Irresponsible AI Reading List April 2024.pdf20240510 QFM016 Irresponsible AI Reading List April 2024.pdf
20240510 QFM016 Irresponsible AI Reading List April 2024.pdf
 
20240509 QFM015 Engineering Leadership Reading List April 2024.pdf
20240509 QFM015 Engineering Leadership Reading List April 2024.pdf20240509 QFM015 Engineering Leadership Reading List April 2024.pdf
20240509 QFM015 Engineering Leadership Reading List April 2024.pdf
 
best call girls in Hyderabad Finest Escorts Service 📞 9352988975 📞 Available ...
best call girls in Hyderabad Finest Escorts Service 📞 9352988975 📞 Available ...best call girls in Hyderabad Finest Escorts Service 📞 9352988975 📞 Available ...
best call girls in Hyderabad Finest Escorts Service 📞 9352988975 📞 Available ...
 
Tadepalligudem Escorts Service Girl ^ 9332606886, WhatsApp Anytime Tadepallig...
Tadepalligudem Escorts Service Girl ^ 9332606886, WhatsApp Anytime Tadepallig...Tadepalligudem Escorts Service Girl ^ 9332606886, WhatsApp Anytime Tadepallig...
Tadepalligudem Escorts Service Girl ^ 9332606886, WhatsApp Anytime Tadepallig...
 
Top profile Call Girls In Dindigul [ 7014168258 ] Call Me For Genuine Models ...
Top profile Call Girls In Dindigul [ 7014168258 ] Call Me For Genuine Models ...Top profile Call Girls In Dindigul [ 7014168258 ] Call Me For Genuine Models ...
Top profile Call Girls In Dindigul [ 7014168258 ] Call Me For Genuine Models ...
 
一比一原版(Curtin毕业证书)科廷大学毕业证原件一模一样
一比一原版(Curtin毕业证书)科廷大学毕业证原件一模一样一比一原版(Curtin毕业证书)科廷大学毕业证原件一模一样
一比一原版(Curtin毕业证书)科廷大学毕业证原件一模一样
 
一比一原版(Offer)康考迪亚大学毕业证学位证靠谱定制
一比一原版(Offer)康考迪亚大学毕业证学位证靠谱定制一比一原版(Offer)康考迪亚大学毕业证学位证靠谱定制
一比一原版(Offer)康考迪亚大学毕业证学位证靠谱定制
 
20240508 QFM014 Elixir Reading List April 2024.pdf
20240508 QFM014 Elixir Reading List April 2024.pdf20240508 QFM014 Elixir Reading List April 2024.pdf
20240508 QFM014 Elixir Reading List April 2024.pdf
 
一比一原版田纳西大学毕业证如何办理
一比一原版田纳西大学毕业证如何办理一比一原版田纳西大学毕业证如何办理
一比一原版田纳西大学毕业证如何办理
 
一比一原版(Flinders毕业证书)弗林德斯大学毕业证原件一模一样
一比一原版(Flinders毕业证书)弗林德斯大学毕业证原件一模一样一比一原版(Flinders毕业证书)弗林德斯大学毕业证原件一模一样
一比一原版(Flinders毕业证书)弗林德斯大学毕业证原件一模一样
 
20240507 QFM013 Machine Intelligence Reading List April 2024.pdf
20240507 QFM013 Machine Intelligence Reading List April 2024.pdf20240507 QFM013 Machine Intelligence Reading List April 2024.pdf
20240507 QFM013 Machine Intelligence Reading List April 2024.pdf
 
Abu Dhabi Escorts Service 0508644382 Escorts in Abu Dhabi
Abu Dhabi Escorts Service 0508644382 Escorts in Abu DhabiAbu Dhabi Escorts Service 0508644382 Escorts in Abu Dhabi
Abu Dhabi Escorts Service 0508644382 Escorts in Abu Dhabi
 
Russian Call girls in Abu Dhabi 0508644382 Abu Dhabi Call girls
Russian Call girls in Abu Dhabi 0508644382 Abu Dhabi Call girlsRussian Call girls in Abu Dhabi 0508644382 Abu Dhabi Call girls
Russian Call girls in Abu Dhabi 0508644382 Abu Dhabi Call girls
 
Local Call Girls in Seoni 9332606886 HOT & SEXY Models beautiful and charmin...
Local Call Girls in Seoni  9332606886 HOT & SEXY Models beautiful and charmin...Local Call Girls in Seoni  9332606886 HOT & SEXY Models beautiful and charmin...
Local Call Girls in Seoni 9332606886 HOT & SEXY Models beautiful and charmin...
 
Call girls Service in Ajman 0505086370 Ajman call girls
Call girls Service in Ajman 0505086370 Ajman call girlsCall girls Service in Ajman 0505086370 Ajman call girls
Call girls Service in Ajman 0505086370 Ajman call girls
 
pdfcoffee.com_business-ethics-q3m7-pdf-free.pdf
pdfcoffee.com_business-ethics-q3m7-pdf-free.pdfpdfcoffee.com_business-ethics-q3m7-pdf-free.pdf
pdfcoffee.com_business-ethics-q3m7-pdf-free.pdf
 
Meaning of On page SEO & its process in detail.
Meaning of On page SEO & its process in detail.Meaning of On page SEO & its process in detail.
Meaning of On page SEO & its process in detail.
 
Story Board.pptxrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr
Story Board.pptxrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrStory Board.pptxrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr
Story Board.pptxrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr
 

Vagrant & Docker

  • 1. Vagrant + Docker Criando ambientes Portáveis entre plataformas João Paraná @joao-parana @joao.parana github: gmail:
  • 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. Step 1: Install Vagrant • http://www.vagrantup.com/downloads.html • Mac OSX • Windows • Debian/Ubuntu • CentosOS/Redhat/Fedora
  • 4. Step 2: Project Setup $ mkdir vagrant_getting_started $ cd vagrant_getting_started $ vagrant init
  • 5. Step 3: Select a Box • http://www.vagrantbox.es • Ubuntu, OpenSuse, OpenBSD, CentOS, Debian.. • Select Provider (VM or Container)
  • 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. Step 5: Up! $ vagrant up Step 6: Connect! $ vagrant ssh
  • 8. 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 • …
  • 9. 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…
  • 10. 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…)
  • 11. Provisioning? • Automatically install software, alter configuration and more • Shell Scripts • File • Puppet (Standalone & Agent) • Chef (Solo & Client) • Ansible • Salt • Docker!!!
  • 12. • 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*)
  • 13. Vagrant and Docker • BOX = Machine • Docker = Container (App package inside the Box) • Functions: Pull, Build, Run • Allow others provisioning (Shell, Puppet, Chef)
  • 14. 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: 8080, host: 9292 v.provision "docker", images: ["parana/web-xe-ubuntu"] v.provision "docker" do |d| d.run "parana/web-xe-ubuntu", args: "-p 9292:8080" end end
  • 17. Want to learn more? • www.vagrantup.com • www.docker.io • GitHub docker • Twitter @docker