But it works on my dev box! How many times have we heard this answer when the app works on one machine, but fails on another? This is the problem that led my team to use Vagrant to gain consistency between environments. However, could Docker be even better? This talk gives an introduction to Vagrant and Docker and explores how they compare.
6. • Purpose:
– Building development environments
• Started:
– January 2010 by Mitchell Hashimoto
• Produced by: HashiCorp
• Open source
– Pay for professional support
• https://www.vagrantup.com
• https://docs.vagrantup.com
• https://vagrantcloud.com
7. • Developer defines the VM
configuration
• Vagrant interfaces with VirtualBox
or other VM manger to build and
launch the VM
• Developer can easily rebuild the
VM
• VM configuration can easily be
shared
How it works
8. • VirtualBox
• VMWare
• AWS-EC2
• Google App Engine
• Many repos of VM images for Vagrant
Adoption
14. • Purpose:
– Build, ship, and run aplications
• Started:
– March 2013 by Solomon Hykes
• Produced by: Docker Inc.
• Open source
– Pay for professional support
• https://www.docker.com
• https://hub.docker.com
15. • Builds on LxC
– LinuX Containers
• Linux kernel cgroups
– Control groups
– Isolation: CPU, memory, block I/O, network
• Linux kernel namespace isolation
• Container runs as an application rather than a
virtual machine
How it works
16. • Support Docker:
– AWS
– Vagrant
– Digital Ocean
– Google App Engine
• Using Docker:
– Ebay
– Yelp
– Spotify
Adoption
17. • Rocket
– CoreOS
– Claims more secure
– Aims to be a more simple container manager
where as Docker as recently focused on managing
containers in clusters etc.
– https://coreos.com/blog/rocket/
Competition
21. Comparison
• Virtual Machine
• Better separation
• Security
• Resource
• Development
environment focus
• Configure
environments
• Can be used for
development
• Can be used for
production
• Light weight
• Portable
• Fast starting/stopping
• Linux only
• Production
deployment focus
• Tied to Docker Repo
I’m Jonathan Chase
Software Engineer with BTI360
- BTI360 has been an awesome place for me to grow as an engineer and learn from some really sharp dudes
I’ve heard that it’s good to open up with something personal to connect with the audience, So..
I have always admired people that can play a musical instrument, but I have never taken the time myself to learn how to play.
The closest I’ve gotten is getting pretty good a the game RockBand.
So I’ve done what any good father would and I’ve “encouraged” my daughter Savannah to learn to play the violin.
So now she’s going to play Old McDonald this weekend at her first recital.
So I am super excited for her, and I found my self a little jealous that she can play and I can’t.
So I had her teach me how to play and I am no master, but I am proud to say that I can now play Old McDonald on the violin.
Now I tell you this to frame our talk today. I am no master of Vagrant and Docker, but I have played around with them enough to share what I’ve learned here today
About a year ago our dev team was running into problems with consistency with our environments.
Some developers were on Windows, some Mac and Linux
Part of our app depended on a specific version of coreutils
We didn’t want to be dependent on AWS or online services for development, so our solution was clearly running VMs locally.
Virtualbox is an awesome tool to enable virtual machine management on ones desktop for free.
New problem: How to we push our VM to our team and how to we push updates to the VM to our team?
We looked at setting up a gold copy VM and creating an image of it and using S3 or Google Docs to make it available to the team.
This proposed solution broke down when we considered how to pus updates to the VM.
Charlie Cook
ON of our developers mentioned we should check out Vagrant
Vagrant turned out the be the solution we were looking for.
Allowed us to leverage a Vagrant configuration file to define our VM and we can keep this config file under version control in Git.
Vagrant then handles the heavy lifting of building the VM and configuring it the way we define.
The first thing that gets me excited about Docker is their logo.
If you notice, the whale has ISO shipping containers on top of it.
I’m a fan of shipping containers. They are so versatile and cheap and just cool.
This is literally a picture of my garage last year when we had 5 shipping containers installed to make a kind of extension to our current garage
The advantage of the ISO container is that the ship or train or truck doesn’t care what’s inside of it. It just know how to move containers.
This is the principle of Docker containers.
If you can define your app or runnable as a container, then a Docker client exposing a Linux kernel can run it.
Comparison
- Venn diagram
- Vagrant for development
- Docker for production
- If your main need is isolation and you require to quickly create several different VE images, then definitely use Docker. Docker is also ideal for environments in which you’re testing several short-lived images, such as when you need different scenarios for testing or debugging software.
- Vagrant is better when you require full VM’s and full isolation for those VM’s.
http://stackoverflow.com/questions/16647069/should-i-use-vagrant-or-docker-io-for-creating-an-isolated-environment
Vagrant is a virtual machine manager, it allows you to script the virtual machine configuration as well as the provisioning. However, it is still a virtual machine depending on Virtual Box (or others) with a huge overhead. It requires you to have a hard drive file that can be huge, it takes a lot of ram, and performance can be not very good.
Docker on the other hand uses kernel cgroup and namespacing via lxc. It means that you are using the same kernel as the host and the same file system. You can use Dockerfile with the docker build command in order to handle the provisioning and configuration of your container. You have example at docs.docker.io on how to make your Dockerfile, it is very intuitive.
The only reason you could want to use vagrant is if you need to do BSD, Windows or other non-linux development on your ubuntu box. Otherwise, go for Docker.