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. 4.

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

    ◦ Install ◦ Run ◦ Build ◦ Host • Docker Machine • Docker Compose • Questions
  2. 9.

    Environment Issues Examples: • substr vs mb_substr functions • short

    open tag <?= • short array syntax (5.3- vs 5.4+): $a=[];
  3. 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
  4. 13.

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

    • IBM 370 - Designed for virtualization via software (CP/CMS).
  5. 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)
  6. 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...
  7. 21.

    Virtualization • If host hardware fails every VMs fail •

    Standard environments • Improve resources usage • Data recovery
  8. 22.

    Virtualization • If host hardware fails every VMs fail •

    Difficult troubleshooting • Standard environments • Improve resources usage • Data recovery
  9. 23.

    Virtualization • If host hardware fails every VMs fail •

    Difficult troubleshooting • New layer = Some Overhead • Standard environments • Improve resources usage • Data recovery
  10. 26.

    Containers - LXC • Since Jul/2008 - Kernel 2.6.26+ •

    lxc-create, lxc- start, lxc-stop • Shares kernel libs and binaries with host
  11. 28.
  12. 29.

    Containers - LXC • Process isolation - 1 Linux PID

    (chroot) • Network isolation • Define memory limitation
  13. 30.

    Containers - LXC • Process isolation - 1 Linux PID

    (chroot) • Network isolation • Define memory limitation • IO overhead - difficult to share host volumes with guests
  14. 31.
  15. 32.
  16. 33.
  17. 36.
  18. 37.

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

    • Change management (imgs) • Automatic build (Dockerfile) Docker
  19. 38.

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

    • Change management (imgs) • Automatic build (Dockerfile) • Reusable (FROM: imagename) Docker
  20. 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
  21. 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
  22. 48.

    Docker - Comparison • Start realy fast • Smaller images

    • Easy replication • Better resources utilization
  23. 49.

    Docker - Comparison • Start realy fast • Smaller images

    • Easy replication • Better resources utilization • IO overhead
  24. 50.

    Docker - Comparison • Start realy fast • Smaller images

    • Easy replication • Better resources utilization • IO overhead • Not too isolated
  25. 51.

    Docker - Comparison • Start realy fast • Smaller images

    • Easy replication • Better resources utilization • IO overhead • Not too isolated • Linux ONLY
  26. 53.

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

    • Why container - because it solves cargo transport matrix
  27. 54.

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

    • Why container - because it solves cargo transport matrix • Why docker, because of docks
  28. 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
  29. 59.

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

    the instructions • FreeBSD hosts will be supported soon Docker - Install
  30. 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
  31. 64.

    • Docker Compose (Old FIG) https://docs. docker.com/compose/install/ • Crane -

    http://getcrane.com • AZK - http://azk.io Orchestration
  32. 69.