All Things Open 2015: DOCKER: EVERYTHING YOU SHOULD KNOW
-
Upload
docker-inc -
Category
Technology
-
view
371 -
download
0
Transcript of All Things Open 2015: DOCKER: EVERYTHING YOU SHOULD KNOW
![Page 1: All Things Open 2015: DOCKER: EVERYTHING YOU SHOULD KNOW](https://reader031.fdocuments.in/reader031/viewer/2022030315/587de4231a28abaf6b8b6125/html5/thumbnails/1.jpg)
Docker: Everything you
should know
1 / 35
![Page 2: All Things Open 2015: DOCKER: EVERYTHING YOU SHOULD KNOW](https://reader031.fdocuments.in/reader031/viewer/2022030315/587de4231a28abaf6b8b6125/html5/thumbnails/2.jpg)
Who am I?Aaron Huslage (@huslage)
Sysadmin since 1993
Since April 2014: Solution Engineer @ Docker
2 / 35
![Page 3: All Things Open 2015: DOCKER: EVERYTHING YOU SHOULD KNOW](https://reader031.fdocuments.in/reader031/viewer/2022030315/587de4231a28abaf6b8b6125/html5/thumbnails/3.jpg)
OutlineWhy Docker?
What's Docker?
How to get started?
3 / 35
![Page 4: All Things Open 2015: DOCKER: EVERYTHING YOU SHOULD KNOW](https://reader031.fdocuments.in/reader031/viewer/2022030315/587de4231a28abaf6b8b6125/html5/thumbnails/4.jpg)
Why Docker?
4 / 35
![Page 5: All Things Open 2015: DOCKER: EVERYTHING YOU SHOULD KNOW](https://reader031.fdocuments.in/reader031/viewer/2022030315/587de4231a28abaf6b8b6125/html5/thumbnails/5.jpg)
Why Docker?Faster application development cycle
Multiplication of environments
Scaling requirements
5 / 35
![Page 6: All Things Open 2015: DOCKER: EVERYTHING YOU SHOULD KNOW](https://reader031.fdocuments.in/reader031/viewer/2022030315/587de4231a28abaf6b8b6125/html5/thumbnails/6.jpg)
Yesterday: slow cycles (months/years)Specification
Implementation
Validation
Release
Maintenance
6 / 35
![Page 7: All Things Open 2015: DOCKER: EVERYTHING YOU SHOULD KNOW](https://reader031.fdocuments.in/reader031/viewer/2022030315/587de4231a28abaf6b8b6125/html5/thumbnails/7.jpg)
Today: fast cycles (weeks/days)Minimum Viable Product
Short iterations (sprints)
Continuous Deployment
A project is never "done" or "over"
Agile methods
7 / 35
![Page 8: All Things Open 2015: DOCKER: EVERYTHING YOU SHOULD KNOW](https://reader031.fdocuments.in/reader031/viewer/2022030315/587de4231a28abaf6b8b6125/html5/thumbnails/8.jpg)
Yesterday: single environmentOne language
One framework
One database
One server (+ sometimes a dev environment)
8 / 35
![Page 9: All Things Open 2015: DOCKER: EVERYTHING YOU SHOULD KNOW](https://reader031.fdocuments.in/reader031/viewer/2022030315/587de4231a28abaf6b8b6125/html5/thumbnails/9.jpg)
Today: many environmentsMany languages
Polyglot platforms
Simultaneous use of SQL, NoSQL ...
The right tool for the right job
Many servers (everybody has their local dev env; there are many envs for testing, CI, QA, etc.)
9 / 35
![Page 10: All Things Open 2015: DOCKER: EVERYTHING YOU SHOULD KNOW](https://reader031.fdocuments.in/reader031/viewer/2022030315/587de4231a28abaf6b8b6125/html5/thumbnails/10.jpg)
Yesterday: slow, vertical deploymentNew versions once in a while
Installed to few servers (sometimes just one)
Scaling = scaling up (you're gonna need a bigger server)
Scaling must be planned far ahead
10 / 35
![Page 11: All Things Open 2015: DOCKER: EVERYTHING YOU SHOULD KNOW](https://reader031.fdocuments.in/reader031/viewer/2022030315/587de4231a28abaf6b8b6125/html5/thumbnails/11.jpg)
Today: rapid, horizontal deploymentNew versions all the time (every week / day / hour)
Installed to many servers
Scaling = scaling out (MOAR servers!)
Need to be able to scale quickly
11 / 35
![Page 12: All Things Open 2015: DOCKER: EVERYTHING YOU SHOULD KNOW](https://reader031.fdocuments.in/reader031/viewer/2022030315/587de4231a28abaf6b8b6125/html5/thumbnails/12.jpg)
What is Docker?
12 / 35
![Page 13: All Things Open 2015: DOCKER: EVERYTHING YOU SHOULD KNOW](https://reader031.fdocuments.in/reader031/viewer/2022030315/587de4231a28abaf6b8b6125/html5/thumbnails/13.jpg)
What is Docker?Container execution engine
Container build system
Container image distribution
Ginormous ecosystem
13 / 35
![Page 14: All Things Open 2015: DOCKER: EVERYTHING YOU SHOULD KNOW](https://reader031.fdocuments.in/reader031/viewer/2022030315/587de4231a28abaf6b8b6125/html5/thumbnails/14.jpg)
Container execution engine~Hypervisor for containers
Container =~ lightweight virtual machine
... What is a container???
14 / 35
![Page 15: All Things Open 2015: DOCKER: EVERYTHING YOU SHOULD KNOW](https://reader031.fdocuments.in/reader031/viewer/2022030315/587de4231a28abaf6b8b6125/html5/thumbnails/15.jpg)
15 / 35
![Page 16: All Things Open 2015: DOCKER: EVERYTHING YOU SHOULD KNOW](https://reader031.fdocuments.in/reader031/viewer/2022030315/587de4231a28abaf6b8b6125/html5/thumbnails/16.jpg)
ContainerIt looks and feels like a VM
Standard UNIX processes, isolated by kernel mechanisms:
namespaces
cgroups (control groups)
copy-on-write
Insanely fast boot times
Insanely low resource usage
16 / 35
![Page 17: All Things Open 2015: DOCKER: EVERYTHING YOU SHOULD KNOW](https://reader031.fdocuments.in/reader031/viewer/2022030315/587de4231a28abaf6b8b6125/html5/thumbnails/17.jpg)
Build systemDockerfile = recipe describing the build process
Easy to learn (similar to shell scripting)
Fast (caching system)
Reliable, reproducible
17 / 35
![Page 18: All Things Open 2015: DOCKER: EVERYTHING YOU SHOULD KNOW](https://reader031.fdocuments.in/reader031/viewer/2022030315/587de4231a28abaf6b8b6125/html5/thumbnails/18.jpg)
Build systemDockerfile = recipe describing the build process
Easy to learn (similar to shell scripting)
Fast (caching system)
Reliable, reproducible
Let's have our cake - and eat it too
(Compared to classic scripting, or configuration management systems like Puppet, Chef, Salt, Ansible...)
18 / 35
![Page 19: All Things Open 2015: DOCKER: EVERYTHING YOU SHOULD KNOW](https://reader031.fdocuments.in/reader031/viewer/2022030315/587de4231a28abaf6b8b6125/html5/thumbnails/19.jpg)
19 / 35
![Page 20: All Things Open 2015: DOCKER: EVERYTHING YOU SHOULD KNOW](https://reader031.fdocuments.in/reader031/viewer/2022030315/587de4231a28abaf6b8b6125/html5/thumbnails/20.jpg)
Image formatProblem: VM images are big
Solution 1: container images are smaller
doesn't need hardware support, kernel, drivers ...
separate handling of logs, metrics, backups ...
Solution 2: images broken down into layers
1 layer = 1 build step
example: base system, packages, code, config
only transfer updated layers
20 / 35
![Page 21: All Things Open 2015: DOCKER: EVERYTHING YOU SHOULD KNOW](https://reader031.fdocuments.in/reader031/viewer/2022030315/587de4231a28abaf6b8b6125/html5/thumbnails/21.jpg)
Distribution protocolProblem: it's both too simple and too complicated
"just do tar or rsync ...
21 / 35
![Page 22: All Things Open 2015: DOCKER: EVERYTHING YOU SHOULD KNOW](https://reader031.fdocuments.in/reader031/viewer/2022030315/587de4231a28abaf6b8b6125/html5/thumbnails/22.jpg)
Distribution protocolProblem: it's both too simple and too complicated
"just do tar or rsync ...
... with these 5 cryptic options, and it works"
22 / 35
![Page 23: All Things Open 2015: DOCKER: EVERYTHING YOU SHOULD KNOW](https://reader031.fdocuments.in/reader031/viewer/2022030315/587de4231a28abaf6b8b6125/html5/thumbnails/23.jpg)
Distribution protocolProblem: it's both too simple and too complicated
"just do tar or rsync ...
... with these 5 cryptic options, and it works"
(mostly)
23 / 35
![Page 24: All Things Open 2015: DOCKER: EVERYTHING YOU SHOULD KNOW](https://reader031.fdocuments.in/reader031/viewer/2022030315/587de4231a28abaf6b8b6125/html5/thumbnails/24.jpg)
Distribution protocolProblem: it's both too simple and too complicated
"just do tar or rsync ...
... with these 5 cryptic options, and it works"
(mostly)
Solution: Docker Registry
transfer layers via an open REST API
open source reference implementation
free service for public images (à la GitHub)
24 / 35
![Page 25: All Things Open 2015: DOCKER: EVERYTHING YOU SHOULD KNOW](https://reader031.fdocuments.in/reader031/viewer/2022030315/587de4231a28abaf6b8b6125/html5/thumbnails/25.jpg)
25 / 35
![Page 26: All Things Open 2015: DOCKER: EVERYTHING YOU SHOULD KNOW](https://reader031.fdocuments.in/reader031/viewer/2022030315/587de4231a28abaf6b8b6125/html5/thumbnails/26.jpg)
Ecosystem: images~100 official images
Linux distros (Debian, Ubuntu, CentOS, Fedora, ...)
components (MySQL, Redis, PostgreSQL, MongoDB, NGINX...)
languages (Python, Ruby, Java, Go, Node...)
applications (Wordpress...)
~150,000 contributed images
26 / 35
![Page 27: All Things Open 2015: DOCKER: EVERYTHING YOU SHOULD KNOW](https://reader031.fdocuments.in/reader031/viewer/2022030315/587de4231a28abaf6b8b6125/html5/thumbnails/27.jpg)
Ecosystem: code~100,000 GitHub repositories have a Dockerfile
~1000 contributors to Docker code
Thousands of projects integrating with Docker
Some official tools:
Machine (deploy Docker hosts)Compose (manage multi-container applications)Swarm (cluster multiple Docker hosts together)
27 / 35
![Page 28: All Things Open 2015: DOCKER: EVERYTHING YOU SHOULD KNOW](https://reader031.fdocuments.in/reader031/viewer/2022030315/587de4231a28abaf6b8b6125/html5/thumbnails/28.jpg)
One example: Docker ComposeAssemble application from multiple containers
Define parameters of each container
how to build it
how to run it (command, arguments, environment...)
network port mappings
linking between containers
28 / 35
![Page 29: All Things Open 2015: DOCKER: EVERYTHING YOU SHOULD KNOW](https://reader031.fdocuments.in/reader031/viewer/2022030315/587de4231a28abaf6b8b6125/html5/thumbnails/29.jpg)
29 / 35
![Page 30: All Things Open 2015: DOCKER: EVERYTHING YOU SHOULD KNOW](https://reader031.fdocuments.in/reader031/viewer/2022030315/587de4231a28abaf6b8b6125/html5/thumbnails/30.jpg)
How to getstarted?
30 / 35
![Page 31: All Things Open 2015: DOCKER: EVERYTHING YOU SHOULD KNOW](https://reader031.fdocuments.in/reader031/viewer/2022030315/587de4231a28abaf6b8b6125/html5/thumbnails/31.jpg)
If you're in a hurryOS X, Windows: Docker Toolbox + boot2docker
tiny VM image (less than 30 MB)
works on (most) physical and virtual machines
Linux: get.docker.com
shell script
usable with Cloud Init or |sh*
* Make sure you use https and nobody gets hurt!
31 / 35
![Page 32: All Things Open 2015: DOCKER: EVERYTHING YOU SHOULD KNOW](https://reader031.fdocuments.in/reader031/viewer/2022030315/587de4231a28abaf6b8b6125/html5/thumbnails/32.jpg)
If you like readingdocs.docker.com
start with "get started" (duh!) (it's written in good old "howto" style)
reference documentations
32 / 35
![Page 33: All Things Open 2015: DOCKER: EVERYTHING YOU SHOULD KNOW](https://reader031.fdocuments.in/reader031/viewer/2022030315/587de4231a28abaf6b8b6125/html5/thumbnails/33.jpg)
If you like looking at / listening totraining.docker.com
Free, official training videos
Intro to Docker (general concepts)
Docker Fundamentals (first steps with Docker)
Docker Operations (using Machine, Swarm, Compose)
33 / 35
![Page 34: All Things Open 2015: DOCKER: EVERYTHING YOU SHOULD KNOW](https://reader031.fdocuments.in/reader031/viewer/2022030315/587de4231a28abaf6b8b6125/html5/thumbnails/34.jpg)
How to "Dockerize" my app?1. Write a Dockerfile for the main component
2. Write a docker-compose.yml for the app itself
3. Use Docker+Compose during development
4. Use Docker+Compose for testing/QA/acceptance...
5. (Optionally) setup CI/CD
6. Go to production with Docker+Compose (static resource scheduling)
If you have 100s of apps with 100s of containers (each): setup a self-service container platform for your developers (using e.g. Swarm, Mesos, Kubernetes...)
34 / 35