Talk on PHP Day Uruguay about Docker

Talk on PHP Day Uruguay about Docker

Talk presented on the first PHP Day in Montevideo Uruguay about Docker from the basics to orchestration

280fecb4f048de5ecf36bec281609ea4?s=128

Wellington F. Silva

August 08, 2015
Tweet

Transcript

  1. Docker From basics to orchestration

  2. About me

  3. Overview

  4. Overview • Environment issues • Virtualization • "Containerization" • Docker

    ◦ Install ◦ Run ◦ Build ◦ Host • Docker Machine • Docker Compose • Questions
  5. Environment Issues

  6. If you do this, you don't receive your: Environment Issues

  7. Examples: • substr vs mb_substr functions Environment Issues

  8. Environment Issues Examples: • substr vs mb_substr functions • short

    open tag <?=
  9. Environment Issues Examples: • substr vs mb_substr functions • short

    open tag <?= • short array syntax (5.3- vs 5.4+): $a=[];
  10. Environment Issues Examples: • substr vs mb_substr functions • short

    open tag <?= • short array syntax (5.3- vs 5.4+): $a=[]; • some custom installed extension on dev but not on prod
  11. Virtualization

  12. • 1960 - cpu time sharing (inspiration) Virtualization - History

  13. Virtualization - History • 1960 - cpu time sharing (inspiration)

    • IBM 370 - Designed for virtualization via software (CP/CMS).
  14. Virtualization - History • 1960 - cpu time sharing (inspiration)

    • IBM 370 - Designed for virtualization via software (CP/CMS). • IBM z/VM - first success case (via hardware)
  15. Virtualization - History • 1960 - cpu time sharing (inspiration)

    • IBM 370 - Designed for virtualization via software (CP/CMS). • IBM z/VM - first success case (via hardware) • 1990+ - Hypervisors: VMWare, Xen, KVM, VirtualBox, etc...
  16. Virtualization - Hypervisors

  17. Virtualization - Stack

  18. Virtualization • Standard environments

  19. Virtualization • Standard environments • Improve resources usage

  20. Virtualization • Standard environments • Improve resources usage • Data

    recovery
  21. Virtualization • If host hardware fails every VMs fail •

    Standard environments • Improve resources usage • Data recovery
  22. Virtualization • If host hardware fails every VMs fail •

    Difficult troubleshooting • Standard environments • Improve resources usage • Data recovery
  23. Virtualization • If host hardware fails every VMs fail •

    Difficult troubleshooting • New layer = Some Overhead • Standard environments • Improve resources usage • Data recovery
  24. Containers - LXC • Since Jul/2008 - Kernel 2.6.26+

  25. • Since Jul/2008 - Kernel 2.6.26+ • lxc-create, lxc- start,

    lxc-stop Containers - LXC
  26. Containers - LXC • Since Jul/2008 - Kernel 2.6.26+ •

    lxc-create, lxc- start, lxc-stop • Shares kernel libs and binaries with host
  27. • Process isolation - 1 Linux PID (chroot) Containers -

    LXC
  28. Containers - LXC • Process isolation - 1 Linux PID

    (chroot) • Network isolation
  29. Containers - LXC • Process isolation - 1 Linux PID

    (chroot) • Network isolation • Define memory limitation
  30. Containers - LXC • Process isolation - 1 Linux PID

    (chroot) • Network isolation • Define memory limitation • IO overhead - difficult to share host volumes with guests
  31. Docker

  32. Docker

  33. Docker

  34. • Copy on write (AUFS) Docker

  35. • Copy on write (AUFS) • Logging (stdout, stderr, stdin)

    Docker
  36. • Copy on write (AUFS) • Logging (stdout, stderr, stdin)

    • Change management (imgs) Docker
  37. • Copy on write (AUFS) • Logging (stdout, stderr, stdin)

    • Change management (imgs) • Automatic build (Dockerfile) Docker
  38. • Copy on write (AUFS) • Logging (stdout, stderr, stdin)

    • Change management (imgs) • Automatic build (Dockerfile) • Reusable (FROM: imagename) Docker
  39. • Copy on write (AUFS) • Logging (stdout, stderr, stdin)

    • Change management (imgs) • Automatic build (Dockerfile) • Reusable (FROM: imagename) • Easy to share (registry - docker hub) Docker
  40. Docker • Copy on write (AUFS) • Logging (stdout, stderr,

    stdin) • Change management (imgs) • Automatic build (Dockerfile) • Reusable (FROM: imagename) • Easy to share (registry - docker hub) • Private and public registry
  41. • API layer (REST) Docker

  42. Docker • API layer (REST) • Fast innovations (compose, machine,

    swarm, network)
  43. Docker Awesome

  44. Docker - Comparison

  45. Docker - Comparison • Start realy fast

  46. Docker - Comparison • Start realy fast • Smaller images

  47. Docker - Comparison • Start realy fast • Smaller images

    • Easy replication
  48. Docker - Comparison • Start realy fast • Smaller images

    • Easy replication • Better resources utilization
  49. Docker - Comparison • Start realy fast • Smaller images

    • Easy replication • Better resources utilization • IO overhead
  50. Docker - Comparison • Start realy fast • Smaller images

    • Easy replication • Better resources utilization • IO overhead • Not too isolated
  51. Docker - Comparison • Start realy fast • Smaller images

    • Easy replication • Better resources utilization • IO overhead • Not too isolated • Linux ONLY
  52. Docker - Quick Tips • It's Container not a VM

  53. Docker - Quick Tips • It's Container not a VM

    • Why container - because it solves cargo transport matrix
  54. Docker - Quick Tips • It's Container not a VM

    • Why container - because it solves cargo transport matrix • Why docker, because of docks
  55. Docker - Quick Tips • It's Container not a VM

    • Why container - because it solves cargo transport matrix • Why docker, because of docks • Images are states, Containers runs it
  56. • Go http://docs.docker.com/installation Docker - Install

  57. • Go http://docs.docker.com/installation • Find you host OS Docker -

    Install
  58. • Go http://docs.docker.com/installation • Find you host OS • Follow

    the instructions Docker - Install
  59. • Go http://docs.docker.com/installation • Find you host OS • Follow

    the instructions • FreeBSD hosts will be supported soon Docker - Install
  60. • Go http://docs.docker.com/installation • Find you host OS • Follow

    the instructions • FreeBSD hosts will be supported soon • MacOS and Windows needs a VM to act as a Host - boot2docker sugested Docker - Install
  61. Docker - Basics "Talk is cheap, show me the code."

    Linus Torvalds
  62. • Volume sharing • Port expose/mapping • Links between containers

    Docker - Medium
  63. Docker Machine Creates virtual machines ready to run docker locally

    or on the cloud.
  64. • Docker Compose (Old FIG) https://docs. docker.com/compose/install/ • Crane -

    http://getcrane.com • AZK - http://azk.io Orchestration
  65. Docker Compose

  66. Docker Compose

  67. • Docker Swarm Docker - Other Cool Stuff

  68. • Docker Swarm • Docker Network Docker - Other Cool

    Stuff
  69. • Docker Swarm • Docker Network • OpenContainers - Linux

    Foundation Docker - Other Cool Stuff
  70. Slides Questions Evaluation