62
Vagrant vs Docker? Melhor Vagrant + Docker

Vagrant vs docker? Melhor vagrant + docker

Embed Size (px)

Citation preview

Page 1: Vagrant vs docker? Melhor vagrant + docker

Vagrant vs Docker?Melhor Vagrant + Docker

Page 2: Vagrant vs docker? Melhor vagrant + docker

About me$nome = 'Wellington F. Silva';$nick = ['_wsilva, 'tom', 'boina', 'fisi', 'iéié'];$work = 'devop';$background = '~2000';$titles = ['ZCE PHP 5.3', 'Técnico Telecom', 'Quase Bacharel SI - USP'];$contact = ['twitter' => '_wsilva'];

Page 3: Vagrant vs docker? Melhor vagrant + docker

Overview● Problema da padronização● Soluções● Virtualização● Conteinerização● Comparação● Vagrant● Demo● Bate papo

Page 4: Vagrant vs docker? Melhor vagrant + docker

O problema

Page 5: Vagrant vs docker? Melhor vagrant + docker

O problema

Page 6: Vagrant vs docker? Melhor vagrant + docker

O problema

Page 7: Vagrant vs docker? Melhor vagrant + docker

O problema

Exemplos:● php substr vs mb_substr

Page 8: Vagrant vs docker? Melhor vagrant + docker

O problema

Exemplos:● php substr vs mb_substr● valor default current_timestamp (MySQL vs

Percona)

Page 9: Vagrant vs docker? Melhor vagrant + docker

Soluções

● Trabalhar direto no servidor (FTP)

Page 10: Vagrant vs docker? Melhor vagrant + docker

Soluções

● Trabalhar direto no servidor (FTP)● Montar na unha o ambiente de cada projeto

Page 11: Vagrant vs docker? Melhor vagrant + docker

Soluções

● Trabalhar direto no servidor (FTP)● Montar na unha o ambiente de cada projeto● Virtualizar

Page 12: Vagrant vs docker? Melhor vagrant + docker

Soluções

● Trabalhar direto no servidor (FTP)● Montar na unha o ambiente de cada projeto● Virtualizar● Conteinerizar

Page 13: Vagrant vs docker? Melhor vagrant + docker

Virtualização

Page 14: Vagrant vs docker? Melhor vagrant + docker

Virtualização

● 1960 - cpu time sharing (inspiração)

Page 15: Vagrant vs docker? Melhor vagrant + docker

Virtualização

● 1960 - cpu time sharing (inspiração)● IBM 370 - Projetado para virtualização. Via

softare com o CP/CMS.

Page 16: Vagrant vs docker? Melhor vagrant + docker

Virtualização

● 1960 - cpu time sharing (inspiração)● IBM 370 - Projetado para virtualização. Via

softare com o CP/CMS.● IBM z/VM - Case de sucesso com

virtualização por hardware.

Page 17: Vagrant vs docker? Melhor vagrant + docker

Virtualização

● 1960 - cpu time sharing (inspiração)● IBM 370 - Projetado para virtualização. Via

softare com o CP/CMS.● IBM z/VM - Case de sucesso com

virtualização por hardware.● Decada de 90 em diante: VMWare, Xen,

KVM, VirtualBox, etc...

Page 18: Vagrant vs docker? Melhor vagrant + docker

Virtualização

Page 19: Vagrant vs docker? Melhor vagrant + docker

Virtualização

Vantagem:● Mesma VM nos ambientes dev, homolog e

prod

Page 20: Vagrant vs docker? Melhor vagrant + docker

Virtualização

Vantagem:● Mesma VM nos ambientes dev, homolog e

prod● Padronização de ambientes.

Page 21: Vagrant vs docker? Melhor vagrant + docker

Virtualização

Desvantagens:● Montagem e inicialização lentos

Page 22: Vagrant vs docker? Melhor vagrant + docker

Virtualização

Desvantagens:● Montagem e inicialização lentos● Gasta muitos recursos de hardware.

Page 23: Vagrant vs docker? Melhor vagrant + docker

Virtualização

Next Step● Técnicas de imagem e snapshots

Page 24: Vagrant vs docker? Melhor vagrant + docker

Virtualização

Next Step● Técnicas de imagem e snapshots● Automação de montagens (Vagrant, Chef,

Puppet, Ansible)

Page 25: Vagrant vs docker? Melhor vagrant + docker

Sistemas complexos

Page 26: Vagrant vs docker? Melhor vagrant + docker

Sistemas complexos

● Difícil reproduzir todos os componentes em dev. (5, 6, 7 até 10 VMs)

Page 27: Vagrant vs docker? Melhor vagrant + docker

Sistemas complexos

● Difícil reproduzir todos os componentes em dev. (5, 6, 7 até 10 VMs)

● Problemas de detalhes de comunicação entre serviços

Page 28: Vagrant vs docker? Melhor vagrant + docker

Sistemas complexos

● Difícil reproduzir todos os componentes em dev. (5, 6, 7 até 10 VMs)

● Problemas de detalhes de comunicação entre serviços

● Difícil testar escalabilidade da aplicação

Page 29: Vagrant vs docker? Melhor vagrant + docker

Conteinerização

Page 30: Vagrant vs docker? Melhor vagrant + docker

Conteinerização

LXC - Linux Containers:● Jul / 2008 - Kernel 2.6.26 +

Page 31: Vagrant vs docker? Melhor vagrant + docker

LXC - Linux Containers:● Jul / 2008 - Kernel 2.6.26 + ● lxc-start

Conteinerização

Page 32: Vagrant vs docker? Melhor vagrant + docker

LXC - Linux Containers:● Jul / 2008 - Kernel 2.6.26 + ● lxc-start● compartilha kernel e libs com o host

Conteinerização

Page 33: Vagrant vs docker? Melhor vagrant + docker

LXC - Linux Containers:● Jul / 2008 - Kernel 2.6.26 + ● lxc-start● compartilha kernel e libs com o host● isola processo nos Control Groups

(CGroups)

Conteinerização

Page 34: Vagrant vs docker? Melhor vagrant + docker

LXC - Linux Containers:● Jul / 2008 - Kernel 2.6.26 + ● lxc-start● compartilha kernel e libs com o host● isola processo nos Control Groups

(CGroups)● difícil gerenciar

Conteinerização

Page 35: Vagrant vs docker? Melhor vagrant + docker

Conteinerização

Page 36: Vagrant vs docker? Melhor vagrant + docker

Docker● Copy on Write

Conteinerização

Page 37: Vagrant vs docker? Melhor vagrant + docker

Docker● Copy on Write● Compartilhamento de imagens (Docker Hub)

Conteinerização

Page 38: Vagrant vs docker? Melhor vagrant + docker

Docker● Copy on Write● Compartilhamento de imagens (Docker Hub)● Receita para criação de container

(Dockerfile)

Conteinerização

Page 39: Vagrant vs docker? Melhor vagrant + docker

Docker● Copy on Write● Compartilhamento de imagens (Docker Hub)● Receita para criação de container

(Dockerfile)● Camada de Api REST

Conteinerização

Page 40: Vagrant vs docker? Melhor vagrant + docker

Docker● Copy on Write● Compartilhamento de imagens (Docker Hub)● Receita para criação de container

(Dockerfile)● Camada de Api REST● Inovando (machine, compose, swarm, etc)

Conteinerização

Page 41: Vagrant vs docker? Melhor vagrant + docker

Conteinerização

Page 42: Vagrant vs docker? Melhor vagrant + docker

Vantagens● sobe muito rápido

Conteinerização

Page 43: Vagrant vs docker? Melhor vagrant + docker

Vantagens● sobe muito rápido● otimiza recursos

Conteinerização

Page 44: Vagrant vs docker? Melhor vagrant + docker

Vantagens● sobe muito rápido● otimiza recursos● fácil replicação

Conteinerização

Page 45: Vagrant vs docker? Melhor vagrant + docker

Vantagens● sobe muito rápido● otimiza recursos● fácil replicação● inovações crescentes (opencontainers.org)

Conteinerização

Page 46: Vagrant vs docker? Melhor vagrant + docker

Desvantagens● Overhead de IO

Conteinerização

Page 47: Vagrant vs docker? Melhor vagrant + docker

Desvantagens● Overhead de IO● Não tão isolado

Conteinerização

Page 48: Vagrant vs docker? Melhor vagrant + docker

Desvantagens● Overhead de IO● Não tão isolado● Só host Linux e conteiners Linux

Conteinerização

Page 49: Vagrant vs docker? Melhor vagrant + docker

Next Steps● suporte ativo a freebsd

Conteinerização

Page 50: Vagrant vs docker? Melhor vagrant + docker

Next Steps● suporte ativo a freebsd● mac osx e windows precisam de uma VM

linux que serve de host para os conteiners

Conteinerização

Page 51: Vagrant vs docker? Melhor vagrant + docker

Next Steps● suporte ativo a freebsd● mac osx e windows precisam de uma VM

linux que serve de host para os conteiners● problema com lentidão de leitura e

permissão de arquivos (vbox-share)

Conteinerização

Page 52: Vagrant vs docker? Melhor vagrant + docker

Next Steps● suporte nativo a freebsd● mac osx e windows precisam de uma VM

linux que sirva de host para os conteiners● problema com lentidão de leitura e

permissão de arquivos (vbox-share)● boot2docker limitado (vbox-share e nfs)

Conteinerização

Page 53: Vagrant vs docker? Melhor vagrant + docker

Vagrant

Page 54: Vagrant vs docker? Melhor vagrant + docker

● suporte a docker desde 1.4.0 (dez, 2013)

Vagrant

Page 55: Vagrant vs docker? Melhor vagrant + docker

● suporte a docker desde 1.4.0 (dez, 2013)● suporte a rsync desde 1.5.0 (mar, 2014)

Vagrant

Page 56: Vagrant vs docker? Melhor vagrant + docker

● suporte a docker desde 1.4.0 (dez, 2013)● suporte a rsync desde 1.5.0 (mar, 2014)● ajuda no problema com lentidão de leitura e

permissão de arquivos (vbox-share)

Vagrant

Page 57: Vagrant vs docker? Melhor vagrant + docker

● suporte a docker desde 1.4.0 (dez, 2013)● suporte a rsync desde 1.5.0 (mar, 2014)● ajuda no problema com lentidão de leitura e

permissão de arquivos (vbox-share)● opções de compartilhamento (vbox-share,

rsync, nfs, sbmfs)

Vagrant

Page 58: Vagrant vs docker? Melhor vagrant + docker

● suporte a docker desde 1.4.0 (dez, 2013)● suporte a rsync desde 1.5.0 (mar, 2014)● ajuda no problema com lentidão de leitura e

permissão de arquivos (vbox-share)● opções de compartilhamento (vbox-share,

rsync, nfs, sbmfs)● Permite outras VMs (CoresOS, Ubuntu, etc)

Vagrant

Page 59: Vagrant vs docker? Melhor vagrant + docker

Demo

Page 60: Vagrant vs docker? Melhor vagrant + docker

A hora da tela azul...

Demo

Page 61: Vagrant vs docker? Melhor vagrant + docker

Perguntas

Page 62: Vagrant vs docker? Melhor vagrant + docker

http://bit.ly/talk-vagrant-docker https://joind.in/14828