Docker and the Container Revolution
-
Upload
romain-dorgueil -
Category
Technology
-
view
426 -
download
3
Transcript of Docker and the Container Revolution
![Page 1: Docker and the Container Revolution](https://reader031.fdocuments.net/reader031/viewer/2022032619/55be0f14bb61eb80258b465b/html5/thumbnails/1.jpg)
The container revolutionStaring Docker, CoreOS, Rocket and guests
December 27th, 2014 Anchor Coworking
Romain Dorgueil [email protected]
![Page 2: Docker and the Container Revolution](https://reader031.fdocuments.net/reader031/viewer/2022032619/55be0f14bb61eb80258b465b/html5/thumbnails/2.jpg)
Who am I ?
Romain DorgueilFounding partner / Tech Advisor @ WeAreTheShops
Founder / CTO @ Monk
➔ Startupper➔ DevOps➔ Python & Linux➔ Electronic sound distorder
![Page 3: Docker and the Container Revolution](https://reader031.fdocuments.net/reader031/viewer/2022032619/55be0f14bb61eb80258b465b/html5/thumbnails/3.jpg)
Monk.cx ?
Most affordable Chief Data Officer ever.
➔ Data management➔ Data processing➔ Data visualisation➔ Data reporting
➔ Geek & Biz friendly.
![Page 4: Docker and the Container Revolution](https://reader031.fdocuments.net/reader031/viewer/2022032619/55be0f14bb61eb80258b465b/html5/thumbnails/4.jpg)
Monk.cx ?
Most affordable Chief Data Officer ever.
➔ Different flavours◆ Software (runs on your laptop)◆ Service (runs on our servers)◆ Appliance (runs on your servers)
➔ Distributed◆ Sync & deploy as simple as git pull/push
![Page 7: Docker and the Container Revolution](https://reader031.fdocuments.net/reader031/viewer/2022032619/55be0f14bb61eb80258b465b/html5/thumbnails/7.jpg)
</advertising>
![Page 8: Docker and the Container Revolution](https://reader031.fdocuments.net/reader031/viewer/2022032619/55be0f14bb61eb80258b465b/html5/thumbnails/8.jpg)
Containers : the origins
![Page 9: Docker and the Container Revolution](https://reader031.fdocuments.net/reader031/viewer/2022032619/55be0f14bb61eb80258b465b/html5/thumbnails/9.jpg)
Containers : the origins
«The system, developed after World War II, dramatically reduced transport costs, supported the post-war boom in international trade, and was a major element in globalization.»
Source : Wikipedia : Containerization
![Page 10: Docker and the Container Revolution](https://reader031.fdocuments.net/reader031/viewer/2022032619/55be0f14bb61eb80258b465b/html5/thumbnails/10.jpg)
Containers : the origins
![Page 11: Docker and the Container Revolution](https://reader031.fdocuments.net/reader031/viewer/2022032619/55be0f14bb61eb80258b465b/html5/thumbnails/11.jpg)
IT Companies : Dev & Ops
➔ Dev & Ops silos are communication antipattern
➔ Communication is expensive
![Page 12: Docker and the Container Revolution](https://reader031.fdocuments.net/reader031/viewer/2022032619/55be0f14bb61eb80258b465b/html5/thumbnails/12.jpg)
IT Companies : Dev & Ops
➔ Developer release a software ... ◆ Don’t want to know about hosting
➔ Operations host a software …◆ Don’t want to know how it works
➔ Problem !
![Page 13: Docker and the Container Revolution](https://reader031.fdocuments.net/reader031/viewer/2022032619/55be0f14bb61eb80258b465b/html5/thumbnails/13.jpg)
IT Companies : Dev & Ops
➔ Modern applications are more and more versatile …
◆ We try a lot more technologies◆ We build smaller components with a lot more
different stuffexample : a java frontend with lots of microservices in python, node, ruby and some distributed services written in haskell or go is not so rare.
➔ Ops can’t possibly know a lot about what they run.
![Page 14: Docker and the Container Revolution](https://reader031.fdocuments.net/reader031/viewer/2022032619/55be0f14bb61eb80258b465b/html5/thumbnails/14.jpg)
Containers in computing
➔ Package applications in a normalized container
➔ Deliver things that always look the same from the outside
➔ Learn how to operate it once, and host anything the same way
➔ Developers can focus on development ➔ Operations can focus on operations
![Page 15: Docker and the Container Revolution](https://reader031.fdocuments.net/reader031/viewer/2022032619/55be0f14bb61eb80258b465b/html5/thumbnails/15.jpg)
➔ Run things➔ Monitor running things➔ Don’t trust those running things➔ Don’t care about what’s running
Containers in computing
![Page 16: Docker and the Container Revolution](https://reader031.fdocuments.net/reader031/viewer/2022032619/55be0f14bb61eb80258b465b/html5/thumbnails/16.jpg)
So what is Docker ?
Docker is an ecosystem defining norms and providing tools make the IT «container revolution» possible.
Docker is not the way. Docker is one way to containairise applications, and the first to get huge traction from professionals.
![Page 17: Docker and the Container Revolution](https://reader031.fdocuments.net/reader031/viewer/2022032619/55be0f14bb61eb80258b465b/html5/thumbnails/17.jpg)
Traction ?
GAFAs and little brothers all says
«I’m doing it for ages»
or …
«I want a piece of the cake»
![Page 18: Docker and the Container Revolution](https://reader031.fdocuments.net/reader031/viewer/2022032619/55be0f14bb61eb80258b465b/html5/thumbnails/18.jpg)
Docker VS Virtual Machines
![Page 19: Docker and the Container Revolution](https://reader031.fdocuments.net/reader031/viewer/2022032619/55be0f14bb61eb80258b465b/html5/thumbnails/19.jpg)
Docker
➔ Modern Linux (3.8+)➔ Linux Containers (LXC)➔ Another Union File System (AUFS)➔ Docker Server (and client …)
![Page 20: Docker and the Container Revolution](https://reader031.fdocuments.net/reader031/viewer/2022032619/55be0f14bb61eb80258b465b/html5/thumbnails/20.jpg)
Docker
➔ Client / Server➔ Manage lifecycle of LXC
◆ nsinit◆ nsenter
➔ Manage images◆ Build◆ Run
➔ Manage files◆ AUFS◆ Volumes◆ Backups
![Page 21: Docker and the Container Revolution](https://reader031.fdocuments.net/reader031/viewer/2022032619/55be0f14bb61eb80258b465b/html5/thumbnails/21.jpg)
Docker : Images
➔ Complete snapshot of a system state➔ Hints about exposed ports➔ Infos about volumes
![Page 22: Docker and the Container Revolution](https://reader031.fdocuments.net/reader031/viewer/2022032619/55be0f14bb61eb80258b465b/html5/thumbnails/22.jpg)
Docker : Images
Example
docker pull -a nginxdocker images | grep nginx
![Page 23: Docker and the Container Revolution](https://reader031.fdocuments.net/reader031/viewer/2022032619/55be0f14bb61eb80258b465b/html5/thumbnails/23.jpg)
Docker : Containers
➔ Take an image➔ Add some environment➔ Run it
![Page 24: Docker and the Container Revolution](https://reader031.fdocuments.net/reader031/viewer/2022032619/55be0f14bb61eb80258b465b/html5/thumbnails/24.jpg)
Docker : Containers
Example
docker run -p 8080:80 nginx:1.7.6
docker run -it --entrypoint=/bin/bash nginx:1.7.6 -i
docker run --detach -p 8080:80 nginx:1.7.6
docker ps
docker run --detach -p 8080:80 --name=web nginx:1.7.6
![Page 25: Docker and the Container Revolution](https://reader031.fdocuments.net/reader031/viewer/2022032619/55be0f14bb61eb80258b465b/html5/thumbnails/25.jpg)
Docker : Volumes
➔ System runs in AUFS➔ Everything is ephemeral ...➔ … but volumes
Volumes are directories marked that will live in the host system.
![Page 26: Docker and the Container Revolution](https://reader031.fdocuments.net/reader031/viewer/2022032619/55be0f14bb61eb80258b465b/html5/thumbnails/26.jpg)
Docker : Volumes
Example
docker run -p 8080:80 -v /usr/share/nginx/html nginx:1.7.6
mkdir website; vim website/index.html
docker run -p 8080:80 -v `pwd`/website:/usr/share/nginx/html nginx:1.7.6
docker run -p 8080:80 -v `pwd`/website:/usr/share/nginx/html:ro nginx:1.7.6
docker run -p 8080:80 -v `pwd`/website:/usr/share/nginx/html:ro nginx:1.7.9
![Page 27: Docker and the Container Revolution](https://reader031.fdocuments.net/reader031/viewer/2022032619/55be0f14bb61eb80258b465b/html5/thumbnails/27.jpg)
Docker : Ports
Example
docker run -p 8080:80 nginx:1.7.6
docker run -P nginx:1.7.6
![Page 28: Docker and the Container Revolution](https://reader031.fdocuments.net/reader031/viewer/2022032619/55be0f14bb61eb80258b465b/html5/thumbnails/28.jpg)
Docker : Links
App 1HTTP on port 8080
DatabaseMySQL (port 3306)
App 2HTTP on port 5000
Load balancerHTTP on port 80
![Page 29: Docker and the Container Revolution](https://reader031.fdocuments.net/reader031/viewer/2022032619/55be0f14bb61eb80258b465b/html5/thumbnails/29.jpg)
Docker : Links
Example
In a moment, with demo.
![Page 30: Docker and the Container Revolution](https://reader031.fdocuments.net/reader031/viewer/2022032619/55be0f14bb61eb80258b465b/html5/thumbnails/30.jpg)
Docker : App & Data Containers
Applications container run stuff.
Data containers are here to define volumes, and exist without running.
You can run a container with “volumes from” another container.
![Page 31: Docker and the Container Revolution](https://reader031.fdocuments.net/reader031/viewer/2022032619/55be0f14bb61eb80258b465b/html5/thumbnails/31.jpg)
Docker : App & Data Containers
Example
docker run --name=dbdata mysql:5.5 true
docker ps -al
docker run --name=db -d -e MYSQL_ROOT_PASSWORD=root \ --volumes-from dbdata -p 3306:3306 mysql:5.5
mysql -h 127.0.0.1 -uroot -p
![Page 32: Docker and the Container Revolution](https://reader031.fdocuments.net/reader031/viewer/2022032619/55be0f14bb61eb80258b465b/html5/thumbnails/32.jpg)
Dockerfiles
Create repeatable recipes to build containers.
Define exposed ports, volumes, what to include, etc.
![Page 33: Docker and the Container Revolution](https://reader031.fdocuments.net/reader031/viewer/2022032619/55be0f14bb61eb80258b465b/html5/thumbnails/33.jpg)
Dockerfiles
Example
FROM google/python-runtimeMAINTAINER John Doe <[email protected]>COPY …EXPOSE …ENTRYPOINT …CMD …
docker build -t my-python-app .
docker run -p 8081:8080 my-python-app
![Page 34: Docker and the Container Revolution](https://reader031.fdocuments.net/reader031/viewer/2022032619/55be0f14bb61eb80258b465b/html5/thumbnails/34.jpg)
Demo : Wordpress
Database already run in container “db”
Let’s start a wordpress container, with a link to db.
docker run --name wp --link db:mysql \-e WORDPRESS_DB_PASSWORD=root -d -P wordpress
![Page 35: Docker and the Container Revolution](https://reader031.fdocuments.net/reader031/viewer/2022032619/55be0f14bb61eb80258b465b/html5/thumbnails/35.jpg)
Demo : Wordpress
Enough time ? Add a nginx front container.
upstream wordpress { server wordpress:5000;}
server { listen 80 default; server_name wordpress.local; location / { proxy_set_header Host $http_host; proxy_set_header X-Real-IP $remote_addr; proxy_pass http://wordpress; }}
![Page 36: Docker and the Container Revolution](https://reader031.fdocuments.net/reader031/viewer/2022032619/55be0f14bb61eb80258b465b/html5/thumbnails/36.jpg)
The ecosystem : Docker Inc.
➔ Docker Hub➔ libcontainer➔ libswarm
![Page 37: Docker and the Container Revolution](https://reader031.fdocuments.net/reader031/viewer/2022032619/55be0f14bb61eb80258b465b/html5/thumbnails/37.jpg)
The ecosystem : CoreOS
➔ CoreOS➔ etcd➔ fleetd➔ flannel➔ rocket
![Page 38: Docker and the Container Revolution](https://reader031.fdocuments.net/reader031/viewer/2022032619/55be0f14bb61eb80258b465b/html5/thumbnails/38.jpg)
The ecosystem : Google
➔ Kubernetes➔ Google Container Engine➔ CAdvisor➔ Python runtime ...
![Page 39: Docker and the Container Revolution](https://reader031.fdocuments.net/reader031/viewer/2022032619/55be0f14bb61eb80258b465b/html5/thumbnails/39.jpg)
The ecosystem : Apache
➔ Mesos
![Page 40: Docker and the Container Revolution](https://reader031.fdocuments.net/reader031/viewer/2022032619/55be0f14bb61eb80258b465b/html5/thumbnails/40.jpg)
The ecosystem : Lot more ...
➔ Digital Ocean➔ Tutum➔ Amazon EC2 Container Service (ECS)➔ … endless list here ...
![Page 43: Docker and the Container Revolution](https://reader031.fdocuments.net/reader031/viewer/2022032619/55be0f14bb61eb80258b465b/html5/thumbnails/43.jpg)
Q&A
➔ Should docker be used on a per-website basis?
➔ How to easily setup docker and git deployment with some <insert your favorite here> backend?
Follow me on twitter : @hartym Ask me anything: [email protected]
![Page 44: Docker and the Container Revolution](https://reader031.fdocuments.net/reader031/viewer/2022032619/55be0f14bb61eb80258b465b/html5/thumbnails/44.jpg)
Q&A
➔ Performance? Benchmarks?- Containers- AUFS
Follow me on twitter : @hartym Ask me anything: [email protected]