Docker: The Good, the Bad & the Hype
Avishai Ish-Shalom (@nukemberg)
Agenda
- What is this docker thing
- What is it good for
- What is it not good for
- How do we use it in real life
- AMA
What is this Docker thing
![](https://s3.amazonaws.com/media-p.slid.es/uploads/50960/images/1981406/wear-the-pants-dockers.jpg)
Demotime!
![](https://s3.amazonaws.com/media-p.slid.es/uploads/50960/images/1987759/hammertime.gif)
Architecture
Namespaces
- Limit visibility & access
- Per process, inherited
- Independent
- e.g. chroot, network, PID
CGROUPS
- Resource accounting & capping
- Control multiprocess behaviours
- e.g. cpu, mem, freezer
CoW storage
- Layered images
- Per container layer
- Fast provisioning
- Runtime overhead
Images
- Layered
- Bundle entire filesystem
- Include metadata
API
- Run container
- Map ports, volumes, etc
- Control container lifecycle
The Good
![](http://janekgwizdala.com/home/wp-content/uploads/clint.jpg)
Convergence
- Decouple servers from apps
- Run multiple services on machine
- Deploy on any server
Avg DC utilization: 7-15% (!!)
Isolation
- Performance isolation
- Data isolation
- Operational isolation
- Process isolation
Efficient
- Small RAM footprint
- Small disk footprint
- Fast provisioning
- Native IO
Universal packages
- Distro independent
- Self contained
App wrapper
- Map ports
- Configuration files
- Redirect output
- Data volumes
The Bad
![](https://crowdfunduk.files.wordpress.com/2012/01/lee.jpg)
Incompatible
New interface - contained process group
- PID namespace init
- Memory limit behavior
- Hostnames
- Port mapping
Shared kernel
- Not fully isolated
- DoS and QoS issues
- Container can kill entire server
- Kernel modules
- Sometimes we need different kernel
The Ugly
![](https://s3.amazonaws.com/media-p.slid.es/uploads/50960/images/1981490/tuco.jpg)
CoW storage
- No quota (except DM)
- Performance issues
OOM behaviour
- No limit
- Swap
- OOM-killer
- Block
No other choice really
Networking/volumes
- Multihost networking in 1.9
- Volume drivers in 1.9
- Performance, debugging
- Very young
Ever seen someone
Brace yourself for
docker pull ahmed-hacker/elk-really-good && \
docker run elk-really-good:latest
curl $URL | sudo sh
Da Faq is it good for?
12 factor apps
- Stateless
- Self contained
- Non-legacy
One-off jobs
- OK if killed
- Stateless
- Retry safe
Don't try this at home
![](https://s3.amazonaws.com/media-p.slid.es/uploads/50960/images/1992921/page2_blog_entry9_2.png)
Statefull apps
- Databases
- Queues
Various issues:
- Hostnames
- IO performance
- OOM
Microservices dev env
How many 16GB ES containers can you put on one 24GB machine?
What happens when you need 100 distributed services.... with data?
Keep it real
![](https://s3.amazonaws.com/media-p.slid.es/uploads/50960/images/1992988/Keep-It-Real--ali-g-565472_321_409.jpg)
Docker in da wild
Few companies rely on docker in production
- Use grids or plan to
- Many issues reported
Production setup
- Use updated kernel
- Prefer DM
- Eco-system
- cAdvisor
- Run on cloud grid if possible
- Run stateless apps
I'm sure u have questions
![](https://s3.amazonaws.com/media-p.slid.es/uploads/50960/images/1993076/weirdest-pictures-on-the-internet-28.jpg)
Docker: The Good, the Bad & the Hype
By Avishai Ish-Shalom
Docker: The Good, the Bad & the Hype
- 3,229