+ All Categories
Home > Technology > Docker and the Container Revolution

Docker and the Container Revolution

Date post: 02-Aug-2015
Category:
Upload: romain-dorgueil
View: 415 times
Download: 3 times
Share this document with a friend
46
The container revolution Staring Docker, CoreOS, Rocket and guests December 27th, 2014 Anchor Coworking Romain Dorgueil [email protected]
Transcript
Page 1: Docker and the Container Revolution

The container revolutionStaring Docker, CoreOS, Rocket and guests

December 27th, 2014 Anchor Coworking

Romain Dorgueil [email protected]

Page 2: Docker and the Container Revolution

Who am I ?

Romain DorgueilFounding partner / Tech Advisor @ WeAreTheShops

Founder / CTO @ Monk

➔ Startupper➔ DevOps➔ Python & Linux➔ Electronic sound distorder

[email protected]

Page 3: Docker and the Container Revolution

Monk.cx ?

Most affordable Chief Data Officer ever.

➔ Data management➔ Data processing➔ Data visualisation➔ Data reporting

➔ Geek & Biz friendly.

[email protected]

Page 4: Docker and the Container Revolution

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

[email protected]

Page 5: Docker and the Container Revolution

Monk.cx ?

http://monk.cx/

[email protected]

Page 6: Docker and the Container Revolution

Monk.cx ?

http://monk.cx/

[email protected]

DATA !

Page 7: Docker and the Container Revolution

</advertising>

Page 8: Docker and the Container Revolution

Containers : the origins

Page 9: Docker and the Container Revolution

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

Containers : the origins

Page 11: Docker and the Container Revolution

IT Companies : Dev & Ops

➔ Dev & Ops silos are communication antipattern

➔ Communication is expensive

Page 12: Docker and the Container Revolution

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

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

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

➔ 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

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

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

Docker VS Virtual Machines

Page 19: Docker and the Container Revolution

Docker

➔ Modern Linux (3.8+)➔ Linux Containers (LXC)➔ Another Union File System (AUFS)➔ Docker Server (and client …)

Page 20: Docker and the Container Revolution

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

Docker : Images

➔ Complete snapshot of a system state➔ Hints about exposed ports➔ Infos about volumes

Page 22: Docker and the Container Revolution

Docker : Images

Example

docker pull -a nginxdocker images | grep nginx

Page 23: Docker and the Container Revolution

Docker : Containers

➔ Take an image➔ Add some environment➔ Run it

Page 24: Docker and the Container Revolution

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

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

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

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

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

Docker : Links

Example

In a moment, with demo.

Page 30: Docker and the Container Revolution

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

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

Dockerfiles

Create repeatable recipes to build containers.

Define exposed ports, volumes, what to include, etc.

Page 33: Docker and the Container Revolution

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

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

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

The ecosystem : Docker Inc.

➔ Docker Hub➔ libcontainer➔ libswarm

Page 37: Docker and the Container Revolution

The ecosystem : CoreOS

➔ CoreOS➔ etcd➔ fleetd➔ flannel➔ rocket

Page 38: Docker and the Container Revolution

The ecosystem : Google

➔ Kubernetes➔ Google Container Engine➔ CAdvisor➔ Python runtime ...

Page 39: Docker and the Container Revolution

The ecosystem : Apache

➔ Mesos

Page 40: Docker and the Container Revolution

The ecosystem : Lot more ...

➔ Digital Ocean➔ Tutum➔ Amazon EC2 Container Service (ECS)➔ … endless list here ...

Page 41: Docker and the Container Revolution

Q&A

Follow me on twitter : @hartym Ask me anything: [email protected]

Page 42: Docker and the Container Revolution

Q&A

➔ How to setup docker on mac?

Follow me on twitter : @hartym Ask me anything: [email protected]

Page 43: Docker and the Container Revolution

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

Q&A

➔ Performance? Benchmarks?- Containers- AUFS

Follow me on twitter : @hartym Ask me anything: [email protected]

Page 45: Docker and the Container Revolution

More Q&A

Follow me on twitter : @hartym Ask me anything: [email protected]

Page 46: Docker and the Container Revolution

Thanks!

Follow me on twitter : @hartym Ask me anything: [email protected]


Recommended