Upgrade to Pro — share decks privately, control downloads, hide ads and more …

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

Wellington F. Silva

August 08, 2015
Tweet

More Decks by Wellington F. Silva

Other Decks in Technology

Transcript

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

    ◦ Install ◦ Run ◦ Build ◦ Host • Docker Machine • Docker Compose • Questions
  2. Environment Issues Examples: • substr vs mb_substr functions • short

    open tag <?= • short array syntax (5.3- vs 5.4+): $a=[];
  3. 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. Virtualization - History • 1960 - cpu time sharing (inspiration)

    • IBM 370 - Designed for virtualization via software (CP/CMS).
  5. 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. 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. Virtualization • If host hardware fails every VMs fail •

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

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

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

    lxc-create, lxc- start, lxc-stop • Shares kernel libs and binaries with host
  11. Containers - LXC • Process isolation - 1 Linux PID

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

    (chroot) • Network isolation • Define memory limitation • IO overhead - difficult to share host volumes with guests
  13. • Copy on write (AUFS) • Logging (stdout, stderr, stdin)

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

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

    • Change management (imgs) • Automatic build (Dockerfile) • Reusable (FROM: imagename) • Easy to share (registry - docker hub) Docker
  16. 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
  17. Docker - Comparison • Start realy fast • Smaller images

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

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

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

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

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

    • Why container - because it solves cargo transport matrix • Why docker, because of docks
  23. 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
  24. • Go http://docs.docker.com/installation • Find you host OS • Follow

    the instructions • FreeBSD hosts will be supported soon Docker - Install
  25. • 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
  26. • Docker Compose (Old FIG) https://docs. docker.com/compose/install/ • Crane -

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