an introduction to contianers and docker for php developers
TRANSCRIPT
![Page 1: An introduction to contianers and Docker for PHP developers](https://reader034.vdocuments.us/reader034/viewer/2022042906/58a3d6ca1a28ab7f0b8b4b0b/html5/thumbnails/1.jpg)
An Introduction to Containers and Docker
for PHP Developerspresented by
Robert McFrazier
1
![Page 3: An introduction to contianers and Docker for PHP developers](https://reader034.vdocuments.us/reader034/viewer/2022042906/58a3d6ca1a28ab7f0b8b4b0b/html5/thumbnails/3.jpg)
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
![Page 4: An introduction to contianers and Docker for PHP developers](https://reader034.vdocuments.us/reader034/viewer/2022042906/58a3d6ca1a28ab7f0b8b4b0b/html5/thumbnails/4.jpg)
Linux ContainersSoftware 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
![Page 5: An introduction to contianers and Docker for PHP developers](https://reader034.vdocuments.us/reader034/viewer/2022042906/58a3d6ca1a28ab7f0b8b4b0b/html5/thumbnails/5.jpg)
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
![Page 6: An introduction to contianers and Docker for PHP developers](https://reader034.vdocuments.us/reader034/viewer/2022042906/58a3d6ca1a28ab7f0b8b4b0b/html5/thumbnails/6.jpg)
Linux ContainersContainers 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.
6Diagram source: Docker Inc.
![Page 7: An introduction to contianers and Docker for PHP developers](https://reader034.vdocuments.us/reader034/viewer/2022042906/58a3d6ca1a28ab7f0b8b4b0b/html5/thumbnails/7.jpg)
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.
DockerWhat is Docker ?
![Page 8: An introduction to contianers and Docker for PHP developers](https://reader034.vdocuments.us/reader034/viewer/2022042906/58a3d6ca1a28ab7f0b8b4b0b/html5/thumbnails/8.jpg)
https://docs.docker.com/installation/
Instructions for installing Docker on 20 different OS/Platforms.
curl -sSL https://get.docker.com/ | sh
DockerInstalling Docker
![Page 9: An introduction to contianers and Docker for PHP developers](https://reader034.vdocuments.us/reader034/viewer/2022042906/58a3d6ca1a28ab7f0b8b4b0b/html5/thumbnails/9.jpg)
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 ComposeWhat is Docker Compose?
![Page 10: An introduction to contianers and Docker for PHP developers](https://reader034.vdocuments.us/reader034/viewer/2022042906/58a3d6ca1a28ab7f0b8b4b0b/html5/thumbnails/10.jpg)
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 ComposeInstalling Docker Compose
![Page 11: An introduction to contianers and Docker for PHP developers](https://reader034.vdocuments.us/reader034/viewer/2022042906/58a3d6ca1a28ab7f0b8b4b0b/html5/thumbnails/11.jpg)
DockerContainer 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.
![Page 12: An introduction to contianers and Docker for PHP developers](https://reader034.vdocuments.us/reader034/viewer/2022042906/58a3d6ca1a28ab7f0b8b4b0b/html5/thumbnails/12.jpg)
VagrantWhy 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.
![Page 13: An introduction to contianers and Docker for PHP developers](https://reader034.vdocuments.us/reader034/viewer/2022042906/58a3d6ca1a28ab7f0b8b4b0b/html5/thumbnails/13.jpg)
DockerOps Focused
Docker has been focused on container deployment.
![Page 14: An introduction to contianers and Docker for PHP developers](https://reader034.vdocuments.us/reader034/viewer/2022042906/58a3d6ca1a28ab7f0b8b4b0b/html5/thumbnails/14.jpg)
Questions ?
![Page 15: An introduction to contianers and Docker for PHP developers](https://reader034.vdocuments.us/reader034/viewer/2022042906/58a3d6ca1a28ab7f0b8b4b0b/html5/thumbnails/15.jpg)
All config/code is in Github
https://github.com/rmcfrazier/pnwphp-docker-intro
![Page 16: An introduction to contianers and Docker for PHP developers](https://reader034.vdocuments.us/reader034/viewer/2022042906/58a3d6ca1a28ab7f0b8b4b0b/html5/thumbnails/16.jpg)
@rmcfrazier http://blog.robert.mcfrazier.com
https://github.com/rmcfrazier/pnwphp-docker-intro
https://joind.in/14931
Robert McFrazier
16