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.

An introduction to contianers and Docker for PHP developers

809 views

Published on

Slide deck for the PNW PHP conference presentation

Published in: Internet
  • Be the first to comment

An introduction to contianers and Docker for PHP developers

  1. 1. An Introduction to Containers and Docker for PHP Developers presented by Robert McFrazier 1
  2. 2. @rmcfrazier http://blog.robert.mcfrazier.com Robert McFrazier 2
  3. 3. Agenda • What are Linux containers • What is Docker • What is Docker Compose • Why use Vagrant • Using Docker • Creating a PHP development environment using Vagrant and Docker • How the PHP community can use containers 3
  4. 4. Linux Containers Software that interfaces with the Linux kernel containment features. Namespaces • Enable creating an abstraction of a particular global system resource and make it appear as a separated instance to processes within a namespace. Control Groups (cgroups) • The kernel uses cgroups to group processes for the purpose of system resource management. Cgroups allocate CPU time, system memory, network bandwidth, or combinations of these among user-defined groups of tasks. 4
  5. 5. Linux Containers Containers fall between a chroot and a full fledged virtual machine. Application level containers have a best practice convention of one process per container. 5
  6. 6. Linux Containers Containers offer less isolation compared to a VM because each container shares the Linux kernel, and possibly binaries and libraries, but they also have a lower resource overhead. 6 Diagram source: Docker Inc.
  7. 7. Docker is a container technology that allows you to package an application with all of its dependencies into a standardized unit for software development. Docker allows applications to share the same Linux kernel as the Docker host. Applications need to be bundled with any software not already installed on the Docker host. Docker What is Docker ?
  8. 8. https://docs.docker.com/installation/ Instructions for installing Docker on 20 different OS/ Platforms. curl -sSL https://get.docker.com/ | sh Docker Installing Docker
  9. 9. Compose is a tool for defining and running multi- container applications with Docker. You define a multi-container application, then spin your application up in a single command which does everything that needs to be done to get it running. Docker Compose What is Docker Compose?
  10. 10. https://docs.docker.com/compose/install/ curl -L https://github.com/docker/compose/releases/ download/1.4/docker-compose-`uname -s`-`uname -m` > /usr/local/bin/docker-compose Docker Compose Installing Docker Compose
  11. 11. Docker Container vs. Image How are a container and an image different? • An image is a read-only template used to create containers. • Images are built. • Containers are started/stopped.
  12. 12. Vagrant Why include Vagrant? • Vagrant is is used to supply a Linux Docker host. • Vagrant also gives us the ability to have a shared folder. • Even if you are on a Linux OS can still use Vagrant, but not required. • Vagrant also gives us Shared folders and make forwarding ports easy.
  13. 13. Docker Ops Focused Docker has been focused on container deployment.
  14. 14. Questions ?
  15. 15. All config/code is in Github https://github.com/rmcfrazier/ pnwphp-docker-intro
  16. 16. @rmcfrazier http://blog.robert.mcfrazier.com https://github.com/rmcfrazier/pnwphp-docker-intro https://joind.in/14931 Robert McFrazier 16

×