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.

Docker na vida real

9,957 views

Published on

Apresentação sobre implantação do Docker e migração de sites, sistemas e serviços. Quais foram as dificuldades e as lições aprendidas.

Published in: Technology
  • DOWNLOAD THE BOOK INTO AVAILABLE FORMAT (New Update) ......................................................................................................................... ......................................................................................................................... Download Full PDF EBOOK here { https://urlzs.com/UABbn } ......................................................................................................................... Download Full EPUB Ebook here { https://urlzs.com/UABbn } ......................................................................................................................... Download Full doc Ebook here { https://urlzs.com/UABbn } ......................................................................................................................... Download PDF EBOOK here { https://urlzs.com/UABbn } ......................................................................................................................... Download EPUB Ebook here { https://urlzs.com/UABbn } ......................................................................................................................... Download doc Ebook here { https://urlzs.com/UABbn } ......................................................................................................................... ......................................................................................................................... ................................................................................................................................... eBook is an electronic version of a traditional print book THE can be read by using a personal computer or by using an eBook reader. (An eBook reader can be a software application for use on a computer such as Microsoft's free Reader application, or a book-sized computer THE is used solely as a reading device such as Nuvomedia's Rocket eBook.) Users can purchase an eBook on diskette or CD, but the most popular method of getting an eBook is to purchase a downloadable file of the eBook (or other reading material) from a Web site (such as Barnes and Noble) to be read from the user's computer or reading device. Generally, an eBook can be downloaded in five minutes or less ......................................................................................................................... .............. Browse by Genre Available eBOOK .............................................................................................................................. Art, Biography, Business, Chick Lit, Children's, Christian, Classics, Comics, Contemporary, CookBOOK, Manga, Memoir, Music, Mystery, Non Fiction, Paranormal, Philosophy, Poetry, Psychology, Religion, Romance, Science, Science Fiction, Self Help, Suspense, Spirituality, Sports, Thriller, Travel, Young Adult, Crime, EBOOK, Fantasy, Fiction, Graphic Novels, Historical Fiction, History, Horror, Humor And Comedy, ......................................................................................................................... ......................................................................................................................... .....BEST SELLER FOR EBOOK RECOMMEND............................................................. ......................................................................................................................... Blowout: Corrupted Democracy, Rogue State Russia, and the Richest, Most Destructive Industry on Earth,-- The Ride of a Lifetime: Lessons Learned from 15 Years as CEO of the Walt Disney Company,-- Call Sign Chaos: Learning to Lead,-- StrengthsFinder 2.0,-- Stillness Is the Key,-- She Said: Breaking the Sexual Harassment Story THE Helped Ignite a Movement,-- Atomic Habits: An Easy & Proven Way to Build Good Habits & Break Bad Ones,-- Everything Is Figureoutable,-- What It Takes: Lessons in the Pursuit of Excellence,-- Rich Dad Poor Dad: What the Rich Teach Their Kids About Money THE the Poor and Middle Class Do Not!,-- The Total Money Makeover: Classic Edition: A Proven Plan for Financial Fitness,-- Shut Up and Listen!: Hard Business Truths THE Will Help You Succeed, ......................................................................................................................... .........................................................................................................................
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • DOWNLOAD THIS BOOKS INTO AVAILABLE FORMAT (2019 Update) ......................................................................................................................... ......................................................................................................................... Download Full PDF EBOOK here { https://soo.gd/irt2 } ......................................................................................................................... Download Full EPUB Ebook here { https://soo.gd/irt2 } ......................................................................................................................... Download Full doc Ebook here { https://soo.gd/irt2 } ......................................................................................................................... Download PDF EBOOK here { https://soo.gd/irt2 } ......................................................................................................................... Download EPUB Ebook here { https://soo.gd/irt2 } ......................................................................................................................... Download doc Ebook here { https://soo.gd/irt2 } ......................................................................................................................... ......................................................................................................................... ................................................................................................................................... eBook is an electronic version of a traditional print book THIS can be read by using a personal computer or by using an eBook reader. (An eBook reader can be a software application for use on a computer such as Microsoft's free Reader application, or a book-sized computer THIS is used solely as a reading device such as Nuvomedia's Rocket eBook.) Users can purchase an eBook on diskette or CD, but the most popular method of getting an eBook is to purchase a downloadable file of the eBook (or other reading material) from a Web site (such as Barnes and Noble) to be read from the user's computer or reading device. Generally, an eBook can be downloaded in five minutes or less ......................................................................................................................... .............. Browse by Genre Available eBooks .............................................................................................................................. Art, Biography, Business, Chick Lit, Children's, Christian, Classics, Comics, Contemporary, Cookbooks, Manga, Memoir, Music, Mystery, Non Fiction, Paranormal, Philosophy, Poetry, Psychology, Religion, Romance, Science, Science Fiction, Self Help, Suspense, Spirituality, Sports, Thriller, Travel, Young Adult, Crime, Ebooks, Fantasy, Fiction, Graphic Novels, Historical Fiction, History, Horror, Humor And Comedy, ......................................................................................................................... ......................................................................................................................... .....BEST SELLER FOR EBOOK RECOMMEND............................................................. ......................................................................................................................... Blowout: Corrupted Democracy, Rogue State Russia, and the Richest, Most Destructive Industry on Earth,-- The Ride of a Lifetime: Lessons Learned from 15 Years as CEO of the Walt Disney Company,-- Call Sign Chaos: Learning to Lead,-- StrengthsFinder 2.0,-- Stillness Is the Key,-- She Said: Breaking the Sexual Harassment Story THIS Helped Ignite a Movement,-- Atomic Habits: An Easy & Proven Way to Build Good Habits & Break Bad Ones,-- Everything Is Figureoutable,-- What It Takes: Lessons in the Pursuit of Excellence,-- Rich Dad Poor Dad: What the Rich Teach Their Kids About Money THIS the Poor and Middle Class Do Not!,-- The Total Money Makeover: Classic Edition: A Proven Plan for Financial Fitness,-- Shut Up and Listen!: Hard Business Truths THIS Will Help You Succeed, ......................................................................................................................... .........................................................................................................................
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • DOWNLOAD THIS BOOKS INTO AVAILABLE FORMAT (2019 Update) ......................................................................................................................... ......................................................................................................................... Download Full PDF EBOOK here { https://soo.gd/irt2 } ......................................................................................................................... Download Full EPUB Ebook here { https://soo.gd/irt2 } ......................................................................................................................... Download Full doc Ebook here { https://soo.gd/irt2 } ......................................................................................................................... Download PDF EBOOK here { https://soo.gd/irt2 } ......................................................................................................................... Download EPUB Ebook here { https://soo.gd/irt2 } ......................................................................................................................... Download doc Ebook here { https://soo.gd/irt2 } ......................................................................................................................... ......................................................................................................................... ................................................................................................................................... eBook is an electronic version of a traditional print book THIS can be read by using a personal computer or by using an eBook reader. (An eBook reader can be a software application for use on a computer such as Microsoft's free Reader application, or a book-sized computer THIS is used solely as a reading device such as Nuvomedia's Rocket eBook.) Users can purchase an eBook on diskette or CD, but the most popular method of getting an eBook is to purchase a downloadable file of the eBook (or other reading material) from a Web site (such as Barnes and Noble) to be read from the user's computer or reading device. Generally, an eBook can be downloaded in five minutes or less ......................................................................................................................... .............. Browse by Genre Available eBooks .............................................................................................................................. Art, Biography, Business, Chick Lit, Children's, Christian, Classics, Comics, Contemporary, Cookbooks, Manga, Memoir, Music, Mystery, Non Fiction, Paranormal, Philosophy, Poetry, Psychology, Religion, Romance, Science, Science Fiction, Self Help, Suspense, Spirituality, Sports, Thriller, Travel, Young Adult, Crime, Ebooks, Fantasy, Fiction, Graphic Novels, Historical Fiction, History, Horror, Humor And Comedy, ......................................................................................................................... ......................................................................................................................... .....BEST SELLER FOR EBOOK RECOMMEND............................................................. ......................................................................................................................... Blowout: Corrupted Democracy, Rogue State Russia, and the Richest, Most Destructive Industry on Earth,-- The Ride of a Lifetime: Lessons Learned from 15 Years as CEO of the Walt Disney Company,-- Call Sign Chaos: Learning to Lead,-- StrengthsFinder 2.0,-- Stillness Is the Key,-- She Said: Breaking the Sexual Harassment Story THIS Helped Ignite a Movement,-- Atomic Habits: An Easy & Proven Way to Build Good Habits & Break Bad Ones,-- Everything Is Figureoutable,-- What It Takes: Lessons in the Pursuit of Excellence,-- Rich Dad Poor Dad: What the Rich Teach Their Kids About Money THIS the Poor and Middle Class Do Not!,-- The Total Money Makeover: Classic Edition: A Proven Plan for Financial Fitness,-- Shut Up and Listen!: Hard Business Truths THIS Will Help You Succeed, ......................................................................................................................... .........................................................................................................................
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • DOWNLOAD THIS BOOKS INTO AVAILABLE FORMAT (2019 Update) ......................................................................................................................... ......................................................................................................................... Download Full PDF EBOOK here { https://soo.gd/irt2 } ......................................................................................................................... Download Full EPUB Ebook here { https://soo.gd/irt2 } ......................................................................................................................... Download Full doc Ebook here { https://soo.gd/irt2 } ......................................................................................................................... Download PDF EBOOK here { https://soo.gd/irt2 } ......................................................................................................................... Download EPUB Ebook here { https://soo.gd/irt2 } ......................................................................................................................... Download doc Ebook here { https://soo.gd/irt2 } ......................................................................................................................... ......................................................................................................................... ................................................................................................................................... eBook is an electronic version of a traditional print book THIS can be read by using a personal computer or by using an eBook reader. (An eBook reader can be a software application for use on a computer such as Microsoft's free Reader application, or a book-sized computer THIS is used solely as a reading device such as Nuvomedia's Rocket eBook.) Users can purchase an eBook on diskette or CD, but the most popular method of getting an eBook is to purchase a downloadable file of the eBook (or other reading material) from a Web site (such as Barnes and Noble) to be read from the user's computer or reading device. Generally, an eBook can be downloaded in five minutes or less ......................................................................................................................... .............. Browse by Genre Available eBooks .............................................................................................................................. Art, Biography, Business, Chick Lit, Children's, Christian, Classics, Comics, Contemporary, Cookbooks, Manga, Memoir, Music, Mystery, Non Fiction, Paranormal, Philosophy, Poetry, Psychology, Religion, Romance, Science, Science Fiction, Self Help, Suspense, Spirituality, Sports, Thriller, Travel, Young Adult, Crime, Ebooks, Fantasy, Fiction, Graphic Novels, Historical Fiction, History, Horror, Humor And Comedy, ......................................................................................................................... ......................................................................................................................... .....BEST SELLER FOR EBOOK RECOMMEND............................................................. ......................................................................................................................... Blowout: Corrupted Democracy, Rogue State Russia, and the Richest, Most Destructive Industry on Earth,-- The Ride of a Lifetime: Lessons Learned from 15 Years as CEO of the Walt Disney Company,-- Call Sign Chaos: Learning to Lead,-- StrengthsFinder 2.0,-- Stillness Is the Key,-- She Said: Breaking the Sexual Harassment Story THIS Helped Ignite a Movement,-- Atomic Habits: An Easy & Proven Way to Build Good Habits & Break Bad Ones,-- Everything Is Figureoutable,-- What It Takes: Lessons in the Pursuit of Excellence,-- Rich Dad Poor Dad: What the Rich Teach Their Kids About Money THIS the Poor and Middle Class Do Not!,-- The Total Money Makeover: Classic Edition: A Proven Plan for Financial Fitness,-- Shut Up and Listen!: Hard Business Truths THIS Will Help You Succeed, ......................................................................................................................... .........................................................................................................................
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • DOWNLOAD THIS BOOKS INTO AVAILABLE FORMAT (2019 Update) ......................................................................................................................... ......................................................................................................................... Download Full PDF EBOOK here { https://soo.gd/irt2 } ......................................................................................................................... Download Full EPUB Ebook here { https://soo.gd/irt2 } ......................................................................................................................... Download Full doc Ebook here { https://soo.gd/irt2 } ......................................................................................................................... Download PDF EBOOK here { https://soo.gd/irt2 } ......................................................................................................................... Download EPUB Ebook here { https://soo.gd/irt2 } ......................................................................................................................... Download doc Ebook here { https://soo.gd/irt2 } ......................................................................................................................... ......................................................................................................................... ................................................................................................................................... eBook is an electronic version of a traditional print book THIS can be read by using a personal computer or by using an eBook reader. (An eBook reader can be a software application for use on a computer such as Microsoft's free Reader application, or a book-sized computer THIS is used solely as a reading device such as Nuvomedia's Rocket eBook.) Users can purchase an eBook on diskette or CD, but the most popular method of getting an eBook is to purchase a downloadable file of the eBook (or other reading material) from a Web site (such as Barnes and Noble) to be read from the user's computer or reading device. Generally, an eBook can be downloaded in five minutes or less ......................................................................................................................... .............. Browse by Genre Available eBooks .............................................................................................................................. Art, Biography, Business, Chick Lit, Children's, Christian, Classics, Comics, Contemporary, Cookbooks, Manga, Memoir, Music, Mystery, Non Fiction, Paranormal, Philosophy, Poetry, Psychology, Religion, Romance, Science, Science Fiction, Self Help, Suspense, Spirituality, Sports, Thriller, Travel, Young Adult, Crime, Ebooks, Fantasy, Fiction, Graphic Novels, Historical Fiction, History, Horror, Humor And Comedy, ......................................................................................................................... ......................................................................................................................... .....BEST SELLER FOR EBOOK RECOMMEND............................................................. ......................................................................................................................... Blowout: Corrupted Democracy, Rogue State Russia, and the Richest, Most Destructive Industry on Earth,-- The Ride of a Lifetime: Lessons Learned from 15 Years as CEO of the Walt Disney Company,-- Call Sign Chaos: Learning to Lead,-- StrengthsFinder 2.0,-- Stillness Is the Key,-- She Said: Breaking the Sexual Harassment Story THIS Helped Ignite a Movement,-- Atomic Habits: An Easy & Proven Way to Build Good Habits & Break Bad Ones,-- Everything Is Figureoutable,-- What It Takes: Lessons in the Pursuit of Excellence,-- Rich Dad Poor Dad: What the Rich Teach Their Kids About Money THIS the Poor and Middle Class Do Not!,-- The Total Money Makeover: Classic Edition: A Proven Plan for Financial Fitness,-- Shut Up and Listen!: Hard Business Truths THIS Will Help You Succeed, ......................................................................................................................... .........................................................................................................................
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here

Docker na vida real

  1. 1. Docker na Vida Real Fernando Ike
  2. 2. Fernando Ike
  3. 3. Clientes Latam
  4. 4. Arquitetura anterior
  5. 5. Incidente "Day 12 Occupy Wall Street September 28 2011 Shankbone 17" by David Shankbone - Eget arbejde. Licensed under Creative Commons Attribution 3.0 via Wikimedia Commons"
  6. 6. "Stamps of Russia 2012 No 1559-61 Mascots 2014 Winter Olympics" by Russian Post, Publishing and Trade Centre "Marka" (ИТЦ «Марка»). The design of the souvenir sheet by O. Shushlebina. Scanned by Dmitry Ivanov. - From a personal collection.. Licensed under Public domain
  7. 7. https://scottlinux.com/2013/04/06/wso-web-shell-php-shell-used-by-hackers/
  8. 8. Incidente ● Plugin Askimet PHP ● PHP Web Shell ● Injeção de páginas web
  9. 9. Rebuilding...
  10. 10. Premissas
  11. 11. Premissas / Requisitos ● Isolamento dos sites/aplicações ● Facilidade de manutenção e migração ● Facilidade de gerar documentação ● Portável
  12. 12. Isolamento Fonte: http://www.itdestination.com/training/courses/adv-linux/
  13. 13. Isolamento / VMs ● Boa documentação ● 1 VM por site/aplicação ● Aumento da complexidade ● Orquestração - Chef, Puppet, etc ● Muito conhecidos ● Custo maior total ● Fácil de documentar
  14. 14. Isolamento / Containers ● Chroot turbinado ● Configuração mais complexa ● +- conhecidos ● VServer não suportado no IaaS contratado ● Relativamente fácil de documentar
  15. 15. Isolamento / Containers ● Chroot turbinado ● Custo baixo ● Fácil de configurar ● Conhecidos ● Fácil de documentar ● Fácil manutenção
  16. 16. Escolhido...
  17. 17. VMs Linode 1 VM = $ 10 8 VMs $ 960/year https://www.flickr.com/photos/editor/6698208975
  18. 18. https://www.flickr.com/photos/bitzcelt/2516437322
  19. 19. Containers 1 VM 8 containers $ 120/year https://www.flickr.com/photos/kalexanderson/6012209875
  20. 20. Docker: Overview ● Criado em 2013 ● Baseado no LXC ● Versionamento de container ● Histórico de mudança ● Like Git ($docker {commit, pull, request, diff, tag}) ● Docker Hub ● Disruptivo/Revolucionário
  21. 21. Ecossistema
  22. 22. Instalando... ● Debian ○ #aptitude install docker.io ● Ubuntu ○ #apt-get install docker.io
  23. 23. FROM php:5.6-apache COPY package /srv/www/app ADD app_apache.conf /etc/apache2/sites-enable/app.conf WORKDIR /srv/www/app CMD [ “/usr/sbin/apache2", "-D", “FOREGROUND” ] Dockerfile
  24. 24. Building and running $docker build --rm --no-cache -t=”app1” . #docker run -d -p 80:80 app1
  25. 25. $docker run -it php:5.6-apache /bin/bash $docker run -it ruby:2.2 irb $docker run -it python:3.4 python
  26. 26. $xhost + $docker run --privileged -v /tmp/.X11-unix:/tmp/.X11-unix -v /home/fike/d:/d -v /var/log/atom:/var/log/atom -e DISPLAY=unix$DISPLAY jess/atom
  27. 27. Rebuilding... http://www.geograph.org.uk/photo/3263456
  28. 28. Nova arquitetura
  29. 29. Rebuilding...
  30. 30. Serviços vs Aplicações Serviços ● Apache/Nginx ● Postgres/MySQL/MongoDB/Memcache ● Rails/Django/Symfony/JBoss ● Ubuntu/Debian/CentOS ● Nginx/Varnish/HAProxy Aplicações ● Site1 (Apache+ Nginx + PHP+Symfony ● Site2 (Apache+ Nginx + PHP+Symfony) ● App1 (Jboss+MySQL+Rabbimq) ● App2 (Django, Unicorn, Cassandra) ● App3 (Wordpress) ● App3 (Drupal)
  31. 31. Dependências
  32. 32. Dependências (bibliotecas) Pacotes .deb, .rpm, etc. ● Dependências controladas pela SO ● "Versões" empacotadas ● Atualizações de Segurança pelo SO ● Controlado pelo SO ● Atualização das versões das bibliotecas + complexas
  33. 33. Dependências (bibliotecas) Composer/PIP/Gems/CPAN, etc... ● Dependências controladas pela "aplicação" ● "Independente" de SO ● "User friendly" para desenvolvedores ● Fácil gerenciamento das “versões” das bibliotecas
  34. 34. https://www.flickr.com/photos/clonedmilkmen/3604999084/in/photostream/
  35. 35. Docker e Rede ● Iptables ● Bridge ● 172.17.XXX.XXX/16 ● Rede entre containers: override /etc/hosts ● Usar o IP de outro container
  36. 36. Docker e Rede $docker run -d -p 9999:9999 app1 $docker run -d -p 9999:9999/udp -p 9999:9999 app1 $docker run [...] --name docker [...] --link database:mysql app1 $docker run [...] --net="container:CONTAINERID" app2
  37. 37. Docker e Rede [...] Chain FORWARD (policy ACCEPT) target prot opt source destination ACCEPT tcp -- 0.0.0.0/0 172.17.0.83 tcp dpt:80 ACCEPT tcp -- 0.0.0.0/0 172.17.0.83 tcp dpt:25 ACCEPT udp -- 0.0.0.0/0 172.17.0.73 udp dpt:53 ACCEPT tcp -- 0.0.0.0/0 172.17.0.73 tcp dpt:53 ACCEPT tcp -- 172.17.0.2 172.17.0.6 tcp spt:5432 ACCEPT tcp -- 172.17.0.6 172.17.0.2 tcp dpt:5432 [...]
  38. 38. Localização - Idioma […] RUN echo "locales locales/locales_to_be_generated multiselect pt_BR.UTF-8 UTF-8" | debconf- set-selections && echo "locales locales/default_environment_locale select pt_BR.UTF-8" | debconf-set- selections RUN apt-get install locales -qq ENV LC_ALL pt_BR.UTF-8 [...]
  39. 39. Segurança
  40. 40. Segurança ● Hardening ● Filesystem bind ● SELinux, Apparmor, Etc.. ● Volumes ● Usuários
  41. 41. http://www.pcworld.com/article/2825032/linux-botnet-mayhem- spreads-through-shellshock-exploits.html
  42. 42. Shellshock ● CVE-2014-6271 ● CVE-2014-6277 ● CVE-2014-6278 ● CVE-2014-7169 ● CVE-2014-7186 ● CVE-2014-7187 ● Remover as imagens base dos containers (Debian, Ubuntu, CoreOS, etc.) ● Rebuild das imagens ● Novo deploy
  43. 43. Lições aprendidas
  44. 44. Lições aprendidas ● “docker build --rm --no-cache ...” + cautela ● SO com muitas regras de firewall (Iptables) ● Monitoramento dos serviços (aplicações)
  45. 45. Lições aprendidas ● Banco de dados em containers ● Múltiplos comandos por passo (step) ● Use “orquestradores” para aplicações complexas (Compose, Kubernetes, Mesos, Deis, Flocker, etc)
  46. 46. TODO ● Usar Chef/Puppet ● Implantar CI (Circles) ● Docker Composer ● libnetworking ● Service Discovery
  47. 47. Links -(Docker) Rede avançado: https://docs.docker.com/articles/networking/ - deb vs. rpm vs. gem: http://lwn.net/Articles/75034/ - Mesos: http://mesos.apache.org/ - Docker + OpenvSwitch: https://goldmann.pl/blog/2014/01/21/connecting-docker-containers-on-multiple-hosts/ - Docker Hub: https://registry.hub.docker.com - Docker Compose: https://docs.docker.com/compose/ - Docker Swarm: https://docs.docker.com/swarm/ -CoreOS: https://coreos.com/ -Kubernete: http://kubernetes.io/ The Docker Ecosystem: Scheduling and Orchestration: https://www.digitalocean.com/community/tutorials/the-docker-ecosystem- scheduling-and-orchestration
  48. 48. Contatos ● http://www.fernandoike.com ● fernando.ike at gmail.com ● https://www.linkedin. com/in/fernandoike ● @fernandoike ● https://hub.docker.com/u/fike/

×