Upload
wellington-silva
View
458
Download
2
Embed Size (px)
Citation preview
DockerFrom basics to orchestration
About me
Overview
Overview
● Environment issues● Virtualization● "Containerization"● Docker
○ Install○ Run○ Build○ Host
● Docker Machine● Docker Compose● Questions
Environment Issues
If you do this, you don't receive your:
Environment Issues
Examples:● substr vs mb_substr functions
Environment Issues
Environment Issues
Examples:● substr vs mb_substr functions● short open tag <?=
Environment Issues
Examples:● substr vs mb_substr functions● short open tag <?=● short array syntax (5.3- vs 5.4+): $a=[];
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
Virtualization
● 1960 - cpu time sharing (inspiration)
Virtualization - History
Virtualization - History
● 1960 - cpu time sharing (inspiration)● IBM 370 - Designed for virtualization via
software (CP/CMS).
Virtualization - History
● 1960 - cpu time sharing (inspiration)● IBM 370 - Designed for virtualization via
software (CP/CMS).● IBM z/VM - first success case (via hardware)
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...
Virtualization - Hypervisors
Virtualization - Stack
Virtualization
● Standard environments
Virtualization
● Standard environments
● Improve resources usage
Virtualization
● Standard environments
● Improve resources usage
● Data recovery
Virtualization
● If host hardware fails every VMs fail
● Standard environments
● Improve resources usage
● Data recovery
Virtualization
● If host hardware fails every VMs fail
● Difficult troubleshooting
● Standard environments
● Improve resources usage
● Data recovery
Virtualization
● If host hardware fails every VMs fail
● Difficult troubleshooting
● New layer = Some Overhead
● Standard environments
● Improve resources usage
● Data recovery
Containers - LXC
● Since Jul/2008 - Kernel 2.6.26+
● Since Jul/2008 - Kernel 2.6.26+
● lxc-create, lxc-start, lxc-stop
Containers - LXC
Containers - LXC
● Since Jul/2008 - Kernel 2.6.26+
● lxc-create, lxc-start, lxc-stop
● Shares kernel libs and binaries with host
● Process isolation - 1 Linux PID (chroot)
Containers - LXC
Containers - LXC
● Process isolation - 1 Linux PID (chroot)● Network isolation
Containers - LXC
● Process isolation - 1 Linux PID (chroot)● Network isolation● Define memory limitation
Containers - LXC
● Process isolation - 1 Linux PID (chroot)● Network isolation● Define memory limitation● IO overhead - difficult to share host
volumes with guests
Docker
Docker
Docker
● Copy on write (AUFS)
Docker
● Copy on write (AUFS)● Logging (stdout, stderr, stdin)
Docker
● Copy on write (AUFS)● Logging (stdout, stderr, stdin)● Change management (imgs)
Docker
● Copy on write (AUFS)● Logging (stdout, stderr, stdin)● Change management (imgs)● Automatic build (Dockerfile)
Docker
● Copy on write (AUFS)● Logging (stdout, stderr, stdin)● Change management (imgs)● Automatic build (Dockerfile)● Reusable (FROM: imagename)
Docker
● Copy on write (AUFS)● Logging (stdout, stderr, stdin)● Change management (imgs)● Automatic build (Dockerfile)● Reusable (FROM: imagename)● Easy to share (registry - docker hub)
Docker
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
● API layer (REST)
Docker
Docker
● API layer (REST)● Fast innovations (compose, machine,
swarm, network)
Docker
Awesome
Docker - Comparison
Docker - Comparison
● Start realy fast
Docker - Comparison
● Start realy fast● Smaller images
Docker - Comparison
● Start realy fast● Smaller images● Easy replication
Docker - Comparison
● Start realy fast● Smaller images● Easy replication● Better resources
utilization
Docker - Comparison
● Start realy fast● Smaller images● Easy replication● Better resources
utilization
● IO overhead
Docker - Comparison
● Start realy fast● Smaller images● Easy replication● Better resources
utilization
● IO overhead● Not too isolated
Docker - Comparison
● Start realy fast● Smaller images● Easy replication● Better resources
utilization
● IO overhead● Not too isolated● Linux ONLY
Docker - Quick Tips
● It's Container not a VM
Docker - Quick Tips
● It's Container not a VM● Why container - because it solves cargo
transport matrix
Docker - Quick Tips
● It's Container not a VM● Why container - because it solves cargo
transport matrix● Why docker, because of docks
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
● Go http://docs.docker.com/installation
Docker - Install
● Go http://docs.docker.com/installation● Find you host OS
Docker - Install
● Go http://docs.docker.com/installation● Find you host OS● Follow the instructions
Docker - Install
● Go http://docs.docker.com/installation● Find you host OS● Follow the instructions● FreeBSD hosts will be supported soon
Docker - Install
● 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
Docker - Basics
"Talk is cheap, show me the code."Linus Torvalds
● Volume sharing● Port expose/mapping● Links between containers
Docker - Medium
Docker Machine
Creates virtual machines ready to run docker locally or on the cloud.
● Docker Compose (Old FIG) https://docs.docker.com/compose/install/
● Crane - http://getcrane.com● AZK - http://azk.io
Orchestration
Docker Compose
Docker Compose
● Docker Swarm
Docker - Other Cool Stuff
● Docker Swarm● Docker Network
Docker - Other Cool Stuff
● Docker Swarm● Docker Network● OpenContainers - Linux Foundation
Docker - Other Cool Stuff
Slides
Questions
Evaluation