SlideShare a Scribd company logo
1 of 101
Maciej Lasyk 
JavaCamp #13 
Kraków, 2014-11-22 
Maciej Lasyk, Docker containers at scale 
1/64 
Orchestrating Docker containers at scale
Join Fedora Infrastructure! 
- learn Ansible 
- learn Docker with Fedora Dockerfiles 
http://fedoraproject.org/en/join-fedora 
Maciej Lasyk, Docker containers at scale 2/64
Agenda 
- Why use Docker? 
- Brief history of envs evolution 
- Docker – what is it? 
- To PaaS or not to PaaS 
- Orchestration at scale 
Maciej Lasyk, Docker containers at scale 3/64
Quick survey 
- How many of you... 
Maciej Lasyk, Docker containers at scale 4/64
Quick survey 
- How many of you... 
- Knows what Docker is? 
Maciej Lasyk, Docker containers at scale 
4/64
Quick survey 
- How many of you... 
- Knows what Docker is? 
- Played with Docker? 
Maciej Lasyk, Docker containers at scale 
4/64
Quick survey 
- How many of you... 
- Knows what Docker is? 
- Played with Docker? 
- Runs it on production? 
Maciej Lasyk, Docker containers at scale 
4/64
Why use Docker? 
With Docker we can solve many problems 
Maciej Lasyk, Docker containers at scale 5/64
Why use Docker? 
With Docker we can solve many problems 
- “it works on my machine” 
Maciej Lasyk, Docker containers at scale 
5/64
Why use Docker? 
With Docker we can solve many problems 
- “it works on my machine” 
- reducing build & deploy time 
Maciej Lasyk, Docker containers at scale 
5/64
Why use Docker? 
With Docker we can solve many problems 
- “it works on my machine” 
- reducing build & deploy time 
- Infrastructure configuration spaghetti – automation! 
Maciej Lasyk, Docker containers at scale 
5/64
Why use Docker? 
With Docker we can solve many problems 
- “it works on my machine” 
- reducing build & deploy time 
- Infrastructure configuration spaghetti – automation! 
- Libs dependency hell 
Maciej Lasyk, Docker containers at scale 
5/64
Why use Docker? 
With Docker we can solve many problems 
- “it works on my machine” 
- reducing build & deploy time 
- Infrastructure configuration spaghetti – automation! 
- Libs dependency hell 
- Cost control and granularity 
Maciej Lasyk, Docker containers at scale 
5/64
A brief story of envs evolution 
- classical approach (for & scp/ssh & conf.d) 
Maciej Lasyk, Docker containers at scale 6/64
A brief story of envs evolution 
- classical approach (for & scp/ssh & conf.d) 
- configuration management 
Maciej Lasyk, Docker containers at scale 
6/64
A brief story of envs evolution 
- classical approach (for & scp/ssh & conf.d) 
- configuration management 
- Bare vs IaaS vs PaaS 
Maciej Lasyk, Docker containers at scale 
6/64
A brief story of envs evolution 
- classical approach (for & scp/ssh & conf.d) 
- configuration management 
- Bare vs IaaS vs PaaS 
- Continuous Integration 
Maciej Lasyk, Docker containers at scale 
6/64
A brief story of envs evolution 
- classical approach (for & scp/ssh & conf.d) 
- configuration management 
- Bare vs IaaS vs PaaS 
- Continuous Integration 
- So when to use Docker? 
Maciej Lasyk, Docker containers at scale 
6/64
Docker – what is it? 
Maciej Lasyk, Docker containers at scale 7/64
Docker – what is it? 
“automates the deployment of any 
application as a lightweight, portable, 
self-sufficient container 
that will run virtually anywhere” 
Maciej Lasyk, Docker containers at scale 8/64
Docker – what is it? 
Java’s promise: Write Once. Run Anywhere. 
Maciej Lasyk, Docker containers at scale 9/64
Docker – what is it? 
Java’s promise: Write Once. Run Anywhere. 
Even on Windows now! 
https://blog.docker.com/2014/10/docker-microsoft-partner-distributed-applications/ 
Maciej Lasyk, Docker containers at scale 
9/64
Docker – what is it? 
Docker is lightweight 
Maciej Lasyk, Docker containers at scale 10/64
Docker – what is it? 
Docker is lightweight 
====================================================== 
Package Arch Version Repository Size 
====================================================== 
Installing: 
docker-io x86_64 1.3.0-1.fc20 updates 4.3 M 
Maciej Lasyk, Docker containers at scale 
10/64
Docker – what is it? 
http://sattia.blogspot.com/2014/05/docker-lightweight-linux-containers-for.html 
Maciej Lasyk, Docker containers at scale 11/64
Docker – how it works? 
http://blog.docker.com/2014/03/docker-0-9-introducing-execution-drivers-and-libcontainer/ 
Maciej Lasyk, Docker containers at scale 12/64
Docker – how it works? 
- LXC & libcontainer 
Maciej Lasyk, Docker containers at scale 13/64
Docker – how it works? 
- LXC & libcontainer 
- control groups 
Maciej Lasyk, Docker containers at scale 13/64
Docker – how it works? 
- LXC & libcontainer 
- control groups 
- kernel namespaces 
Maciej Lasyk, Docker containers at scale 13/64
Docker – how it works? 
- LXC & libcontainer 
- control groups 
- kernel namespaces 
- layered filesystem 
- btrfs 
- devmapper thin provisioning & loopback mounts 
- no more AUFS 
- http://developerblog.redhat.com/2014/09/30/overview-storage-scalability-docker/ 
Maciej Lasyk, Docker containers at scale 13/64
Docker – concepts 
- images 
- read only 
- act as templates 
Maciej Lasyk, Docker containers at scale 14/64
Docker – concepts 
- images 
- read only 
- act as templates 
- Dockerfile 
- like a makefile 
- commands order & cache'ing 
- extends the base image 
- results in a new image 
Maciej Lasyk, Docker containers at scale 14/64
Docker – concepts 
- images 
- read only 
- act as templates 
- Dockerfile 
- like a makefile 
- commands order & cache'ing 
- extends the base image 
- results in a new image 
- Containers: instances running apps 
Maciej Lasyk, Docker containers at scale 14/64
Docker – concepts 
- images 
- read only 
- act as templates 
- Dockerfile 
- like a makefile 
- commands order & cache'ing 
- extends the base image 
- results in a new image 
- Containers: instances running apps 
dockerfile + base image = docker container 
Maciej Lasyk, Docker containers at scale 14/64
Dockerfile 
FROM fedora 
MAINTAINER scollier <scollier@redhat.com> 
RUN yum -y update && yum clean all 
RUN yum -y install nginx && yum clean all 
RUN echo "daemon off;" >> /etc/nginx/nginx.conf 
RUN echo "nginx on Fedora" > /srv/www/index.html 
EXPOSE 80 
CMD [ "/usr/sbin/nginx" ] 
Maciej Lasyk, Docker containers at scale 15/64
Docker – registry 
http://osv.io/blog/blog/2014/06/19/containers-hypervisors-part-2/ 
Maciej Lasyk, Docker containers at scale 16/64
Docker – registry 
- git like semantics 
- pull, push, commit 
- private and public registry 
- https://github.com/dotcloud/docker-registry 
- yum install docker-registry 
$ docker pull 
$ docker push 
$ docker commit 
Maciej Lasyk, Docker containers at scale 17/64
Docker – images hierarchy 
base image 
-> child image 
-> grandchild image 
Maciej Lasyk, Docker containers at scale 18/64
Docker – images hierarchy 
base image 
-> child image 
-> grandchild image 
Git’s promise: Tiny footprint with 
lightning fast performance 
Maciej Lasyk, Docker containers at scale 
18/64
Docker – images hierarchy 
http://blog.octo.com/en/docker-registry-first-steps/ 
Maciej Lasyk, Docker containers at scale 19/64
Docker – security 
- Isolation via kernel namespaces 
- Additional layer of security: SELinux / AppArmor / GRSEC 
- Each container gets own network stack 
- control groups for resources limiting 
f20 policy: https://git.fedorahosted.org/cgit/selinux-policy.git/tree/docker.te?h=f20-contrib 
What's there? 
seinfo -t -x | grep docker 
sesearch -A -s docker_t (and the rest) 
or just unpack docker.pp with semodule_unpackage 
Maciej Lasyk, Docker containers at scale 20/64
Docker – security 
Maciej Lasyk, Docker containers at scale 20/64
Docker – use cases 
CI Stack 
http://sattia.blogspot.com/2014/05/docker-lightweight-linux-containers-for.html 
Maciej Lasyk, Docker containers at scale 21/64
Docker – use cases 
Continuous Integration 
- local dev 
- with Docker it's easy to standardize envs 
- deployment 
- rolling updates (e.g. w/Ansible) 
- testing 
- unit testing of any commit on dedicated env 
- don't worry about cleaning up after testing 
- parrarelized tests across any machines 
Maciej Lasyk, Docker containers at scale 22/64
Docker – use cases 
- version control system for apps 
- microservices 
- Docker embraces granularity 
- Services can be deployed independently and faster 
- parallelized tests across any machines 
- continuous delivery 
- PaaS 
Maciej Lasyk, Docker containers at scale 23/64
Docker – history 
- 2013-01: dotCloud worked on own PaaS (Python based) 
- 2013-03: Docker went public (AUFS, LXC) 
- middle 2013: Red Hat joined, devmapper, SELinux 
- late 2013: removed LXC, rewritten in Go 
- 2014-02: stable 1.0 
Maciej Lasyk, Docker containers at scale 24/64
Docker – popularity 
Maciej Lasyk, Docker containers at scale 25/64
Docker – popularity 
Maciej Lasyk, Docker containers at scale 26/64
Orchestration at scale w/Docker 
Maciej Lasyk, Docker containers at scale 27/64
Orchestration at scale w/Docker 
This might be a little problem 
Maciej Lasyk, Docker containers at scale 28/64
Orchestration at scale w/Docker 
This might be a little problem 
Maciej Lasyk, Docker containers at scale 29/64
Orchestration at scale w/Docker 
Maciej Lasyk, Docker containers at scale 30/64
http://www.cloudssky.com/en/blog/Docker-Is-Not-Enough 
Maciej Lasyk, Docker containers at scale 31/64
To Paas or not to PaaS? 
Maciej Lasyk, Docker containers at scale 32/64
To Paas or not to PaaS? 
- you think PaaS will solve your problems? 
Maciej Lasyk, Docker containers at scale 33/64
To Paas or not to PaaS? 
- you think PaaS will solve your problems? 
- it will rather clone them :) 
Maciej Lasyk, Docker containers at scale 
33/64
To Paas or not to PaaS? 
- you think PaaS will solve your problems? 
- it will rather clone them :) 
- running PaaS might be easy 
Maciej Lasyk, Docker containers at scale 
33/64
To Paas or not to PaaS? 
- you think PaaS will solve your problems? 
- it will rather clone them :) 
- running PaaS might be easy 
- operating PaaS will be tough 
Maciej Lasyk, Docker containers at scale 
33/64
To Paas or not to PaaS? 
- you think PaaS will solve your problems? 
- it will rather clone them :) 
- running PaaS might be easy 
- operating PaaS will be tough 
- so is operating your apps tough enough to move? 
Maciej Lasyk, Docker containers at scale 
33/64
To Paas or not to PaaS? 
- you think PaaS will solve your problems? 
- it will rather clone them :) 
- running PaaS might be easy 
- operating PaaS will be tough 
- so is operating your apps tough enough to move? 
- private PaaS or not? 
Maciej Lasyk, Docker containers at scale 
33/64
To Paas or not to PaaS? 
- you think PaaS will solve your problems? 
- it will rather clone them :) 
- running PaaS might be easy 
- operating PaaS will be tough 
- so is operating your apps tough enough to move? 
- private PaaS or not? 
- Rainbow and Unicorn Piss: 
http://blog.lusis.org/blog/2014/06/14/paas-for-realists/ 
Maciej Lasyk, Docker containers at scale 
33/64
To Paas or not to PaaS? 
Maciej Lasyk, Docker containers at scale 
- flynn.io 
- Open source PaaS (Go) 
- Uses Docker to manage containers 
- Ops should be a product team, not consultants 
- under development 
- Git push deployment 
- https://flynn.io 
34/64
To Paas or not to PaaS? 
Maciej Lasyk, Docker containers at scale 
- flynn.io 
- Open source PaaS (Go) 
- Uses Docker to manage containers 
- Ops should be a product team, not consultants 
- under development 
- Git push deployment 
- https://flynn.io 
- dokku 
- The smallest PaaS implementation you've ever seen 
- Docker powered mini-Heroku 
- Less than 100 lines of Bash 
- Git push deployment 
- https://github.com/progrium/dokku 
34/64
To Paas or not to PaaS? 
Maciej Lasyk, Docker containers at scale 
- flynn.io 
- Open source PaaS (Go) 
- Uses Docker to manage containers 
- Ops should be a product team, not consultants 
- under development 
- Git push deployment 
- https://flynn.io 
- dokku 
- The smallest PaaS implementation you've ever seen 
- Docker powered mini-Heroku 
- Less than 100 lines of Bash 
- Git push deployment 
- https://github.com/progrium/dokku 
- deis.io 
- Open source PaaS (Python) 
- Git push deployment 
- On top of CoreOS w/ Docker 
- http://deis.io/ 
34/64
To Paas or not to PaaS? 
Don't forget maestro-ng! 
https://github.com/signalfuse/maestro-ng 
Maciej Lasyk, Docker containers at scale 
- flynn.io 
- Open source PaaS (Go) 
- Uses Docker to manage containers 
- Ops should be a product team, not consultants 
- under development 
- Git push deployment 
- https://flynn.io 
- dokku 
- The smallest PaaS implementation you've ever seen 
- Docker powered mini-Heroku 
- Less than 100 lines of Bash 
- Git push deployment 
- https://github.com/progrium/dokku 
- deis.io 
- Open source PaaS (Python) 
- Git push deployment 
- On top of CoreOS w/ Docker 
- http://deis.io/ 
34/64
To Paas or not to PaaS? 
Remember, that PaaS might fail; plan & test for disaster ! 
Maciej Lasyk, Docker containers at scale 35/64
Docker & CLI 
$ docker run -t -i fedora /bin/bash 
> yum -y update 
> yum -y install nginx 
$ docker commit 73fa45674fd docent/fedora 
Maciej Lasyk, Docker containers at scale 36/64
Docker & CLI 
Or via Dockerfile: 
$ docker build -t fedora –rm . 
$ docker run --name=nginx fedora 
Maciej Lasyk, Docker containers at scale 37/64
FIG 
- http://www.fig.sh 
- for single host env 
Maciej Lasyk, Docker containers at scale 38/64
FIG 
- http://www.fig.sh 
- for single host env 
FROM python:2.7 
ENV PYTHONUNBUFFERED 1 
RUN mkdir /code 
WORKDIR /code 
ADD requirements.txt /code/ 
RUN pip install -r requirements.txt 
ADD . /code/ 
Maciej Lasyk, Docker containers at scale 39/64
FIG 
db: 
image: postgres 
web: 
build: . 
command: python manage.py 
runserver 0.0.0.0:8000 
volumes: 
- /srv/app/code:/code 
ports: 
- "8000:8000" 
links: 
- db 
Maciej Lasyk, Docker containers at scale 40/64
FIG 
$ fig run web django-admin.py startproject figexample . 
$ fig up 
Management during runtime? 
$ fig run web python manage.py syncdb 
Maciej Lasyk, Docker containers at scale 41/64
Docker & Ansible 
Ansible + Docker 
& 
Docker + Ansible 
Maciej Lasyk, Docker containers at scale 42/64
Docker & Ansible 
Ansible docker core module: 
http://docs.ansible.com/docker_module.html 
- hosts: web 
sudo: yes 
tasks: 
- name: run tomcat servers 
docker: > 
image=centos 
command="service tomcat6 start" 
ports=8080 
count=5 
memory_limit=128MB 
link=mysql 
expose=8080 
registry=... 
volume=... 
Maciej Lasyk, Docker containers at scale 43/64
Docker & Ansible 
Building image with Ansible: 
FROM ansible/centos7-ansible:stable 
ADD ansible /srv/example/ 
WORKDIR /srv/example 
RUN ansible-playbook web.yml -c local 
EXPOSE 80 
ENTRYPOINT ["/usr/sbin/nginx", "-DFOREGROUND"] 
Maciej Lasyk, Docker containers at scale 44/64
Docker & Ansible 
Building image with Ansible: 
FROM ansible/centos7-ansible:stable 
ADD ansible /srv/example/ 
WORKDIR /srv/example 
RUN ansible-playbook web.yml -c local 
EXPOSE 80 
ENTRYPOINT ["/usr/sbin/nginx", "-DFOREGROUND"] 
ansible/web.yml: 
- hosts: localhost 
tasks: 
- yum: pkg=nginx state=latest 
- copy: 
src: web.conf 
dest: /etc/nginx/conf.d/web.conf 
group: "nginx" 
mode: "0644" 
Maciej Lasyk, Docker containers at scale 
44/64
CoreOS 
- Designedfor massive server deployments 
- Support Docker container out of the box 
- Available onLinux, Mac, and Windows 
- It's a Chrome OS fork 
- Consists of couple of components: 
- SystemD – not just a init system ;) 
- Fleet – cluster level manager & scheduler 
- etcd – light & distributed key / value store 
- Docker – the only packaging method in CoreOS 
Maciej Lasyk, Docker containers at scale 45/64
CoreOS 
Maciej Lasyk, Docker containers at scale 45/64
CoreOS 
Fleet – cluster level manager & scheduler 
https://coreos.com/using-coreos/clustering/ 
Maciej Lasyk, Docker containers at scale 46/64
CoreOS 
etcd – light & distributed key / value store 
(used for configuration store) 
https://coreos.com/docs/#cluster-management 
Maciej Lasyk, Docker containers at scale 47/64
CoreOS 
Docker – the only 
packaging method 
in CoreOS 
Maciej Lasyk, Docker containers at scale 48/64
CoreOS 
Maciej Lasyk, Docker containers at scale 49/64
CoreOS 
Cluster management with Fleet & SystemD 
[Unit] 
Description=My Service 
After=docker.service 
[Service] 
TimeoutStartSec=0 
ExecStartPre=-/usr/bin/docker kill hello 
ExecStartPre=-/usr/bin/docker rm hello 
ExecStartPre=/usr/bin/docker pull busybox 
ExecStart=/usr/bin/docker run --name hello busybox /bin/sh -c 
"while true; do echo Hello World; sleep 1; done" 
ExecStop=/usr/bin/docker stop hello 
Maciej Lasyk, Docker containers at scale 50/64
CoreOS 
Cluster management with Fleet & SystemD 
$ fleetctl load hello.service 
Unit hello.service loaded on 8145ebb7.../10.10.1.3 
$ fleetctl start hello.service 
Unit hello.service launched on 8145ebb7.../10.10.1.3 
$ fleetctl list-machines 
MACHINE IP METADATA 
148a18ff-6e95-4cd8-92da-c9de9bb90d5a 10.10.1.1 - 
491586a6-508f-4583-a71d-bfc4d146e996 10.10.1.2 - 
c9de9451-6a6f-1d80-b7e6-46e996bfc4d1 10.10.1.3 - 
$ fleetctl list-units 
UNIT MACHINE ACTIVE SUB 
hello.service c9de9451.../10.10.1.3 active running 
Maciej Lasyk, Docker containers at scale 51/64
CoreOS 
- scheduler 
- HA 
- dependencies 
https://coreos.com/docs/launching-containers/launching/launching-containers-fleet/ 
Maciej Lasyk, Docker containers at scale 52/64
Kubernetes 
- https://github.com/GoogleCloudPlatform/kubernetes 
- Advanced cluster manager (more than 1k hosts is a fit) 
- Architecture: 
- master 
- minion 
- pod 
- replication controller 
- label 
Maciej Lasyk, Docker containers at scale 53/64
Kubernetes 
Maciej Lasyk, Docker containers at scale 54/64
Kubernetes 
Maciej Lasyk, Docker containers at scale 54/64
SmartStack 
- automated service discovery and registration framework 
- ideal for SOA architectures 
- ideal for continuous integration & delivery 
- solves “works on my machine” problem 
Maciej Lasyk, Docker containers at scale 55/64
SmartStack 
- automated service discovery and registration framework 
- ideal for SOA architectures 
- ideal for continuous integration & delivery 
- solves “works on my machine” problem 
haproxy + nerve + synapse + zookeper = smartstack 
Maciej Lasyk, Docker containers at scale 56/64
SmartStack 
Synapse 
- discovery service (via zookeeper or etcd) 
- installed on every node 
- writes haproxy configuration 
- application doesn't have to be aware of this 
- works same on bare / VM / docker 
- https://github.com/airbnb/nerve 
Maciej Lasyk, Docker containers at scale 57/64
SmartStack 
Maciej Lasyk, Docker containers at scale 58/64
SmartStack 
Nerve 
- health checks (pluggable) 
- register service info to zookeper (or etcd) 
- https://github.com/airbnb/synapse 
Maciej Lasyk, Docker containers at scale 59/64
SmartStack 
Maciej Lasyk, Docker containers at scale 60/64
SmartStack 
Maciej Lasyk, Docker containers at scale 60/64
SmartStack 
Smartstack + Docker = <3 
Maciej Lasyk, Docker containers at scale 60/64
Summary 
Maciej Lasyk, Docker containers at scale 61/64
Summary 
w/ Docker Sky is the limit! 
Maciej Lasyk, Docker containers at scale 
61/64
Freenode #docker 
Krk DevOPS meetups (http://www.meetup.com/Krakow-DevOps/) 
https://github.com/docker/docker 
Maciej Lasyk, Docker containers at scale 62/64
sources? 
- docker.io documentation 
- dockerbook.com 
- slideshare! 
- zounds of blogposts (urls provided) 
- and some experience ;) 
Maciej Lasyk, Docker containers at scale 63/64
Thank you :) 
Orchestrating Docker containers at scale 
Maciej Lasyk 
JavaCamp #13 
2014-11-22, Kraków 
http://maciej.lasyk.info 
maciej@lasyk.info 
@docent-net 
Maciej Lasyk, Docker containers at scale 64/64

More Related Content

What's hot

Docker - The Linux Container
Docker - The Linux ContainerDocker - The Linux Container
Docker - The Linux Container
Balaji Rajan
 
Docker Introduction + what is new in 0.9
Docker Introduction + what is new in 0.9 Docker Introduction + what is new in 0.9
Docker Introduction + what is new in 0.9
Jérôme Petazzoni
 

What's hot (20)

Docker 101 @KACST Saudi HPC 2016
Docker 101  @KACST Saudi HPC 2016Docker 101  @KACST Saudi HPC 2016
Docker 101 @KACST Saudi HPC 2016
 
Introduction to Docker at SF Peninsula Software Development Meetup @Guidewire
Introduction to Docker at SF Peninsula Software Development Meetup @GuidewireIntroduction to Docker at SF Peninsula Software Development Meetup @Guidewire
Introduction to Docker at SF Peninsula Software Development Meetup @Guidewire
 
Introduction to Docker and all things containers, Docker Meetup at RelateIQ
Introduction to Docker and all things containers, Docker Meetup at RelateIQIntroduction to Docker and all things containers, Docker Meetup at RelateIQ
Introduction to Docker and all things containers, Docker Meetup at RelateIQ
 
Docker from A to Z, including Swarm and OCCS
Docker from A to Z, including Swarm and OCCSDocker from A to Z, including Swarm and OCCS
Docker from A to Z, including Swarm and OCCS
 
A Hands-on Introduction to Docker
A Hands-on Introduction to DockerA Hands-on Introduction to Docker
A Hands-on Introduction to Docker
 
Docker workshop
Docker workshopDocker workshop
Docker workshop
 
A Gentle Introduction To Docker And All Things Containers
A Gentle Introduction To Docker And All Things ContainersA Gentle Introduction To Docker And All Things Containers
A Gentle Introduction To Docker And All Things Containers
 
Introduction to docker
Introduction to dockerIntroduction to docker
Introduction to docker
 
Real-World Docker: 10 Things We've Learned
Real-World Docker: 10 Things We've Learned  Real-World Docker: 10 Things We've Learned
Real-World Docker: 10 Things We've Learned
 
All Things Containers - Docker, Kubernetes, Helm, Istio, GitOps and more
All Things Containers - Docker, Kubernetes, Helm, Istio, GitOps and moreAll Things Containers - Docker, Kubernetes, Helm, Istio, GitOps and more
All Things Containers - Docker, Kubernetes, Helm, Istio, GitOps and more
 
Docker by Example - Basics
Docker by Example - Basics Docker by Example - Basics
Docker by Example - Basics
 
Visualising Basic Concepts of Docker
Visualising Basic Concepts of Docker Visualising Basic Concepts of Docker
Visualising Basic Concepts of Docker
 
Docker - The Linux Container
Docker - The Linux ContainerDocker - The Linux Container
Docker - The Linux Container
 
From development environments to production deployments with Docker, Compose,...
From development environments to production deployments with Docker, Compose,...From development environments to production deployments with Docker, Compose,...
From development environments to production deployments with Docker, Compose,...
 
Docker Introduction + what is new in 0.9
Docker Introduction + what is new in 0.9 Docker Introduction + what is new in 0.9
Docker Introduction + what is new in 0.9
 
Docker - 15 great Tutorials
Docker - 15 great TutorialsDocker - 15 great Tutorials
Docker - 15 great Tutorials
 
Architecting .NET Applications for Docker and Container Based Deployments
Architecting .NET Applications for Docker and Container Based DeploymentsArchitecting .NET Applications for Docker and Container Based Deployments
Architecting .NET Applications for Docker and Container Based Deployments
 
Docker, the Future of DevOps
Docker, the Future of DevOpsDocker, the Future of DevOps
Docker, the Future of DevOps
 
Introduction to Docker and deployment and Azure
Introduction to Docker and deployment and AzureIntroduction to Docker and deployment and Azure
Introduction to Docker and deployment and Azure
 
Docker From Scratch
Docker From ScratchDocker From Scratch
Docker From Scratch
 

Viewers also liked

53th anniversary of the Berlin Wall
53th anniversary of the Berlin Wall53th anniversary of the Berlin Wall
53th anniversary of the Berlin Wall
guimera
 
Grafico diario del dax perfomance index para el 08 03-2013
Grafico diario del dax perfomance index para el 08 03-2013Grafico diario del dax perfomance index para el 08 03-2013
Grafico diario del dax perfomance index para el 08 03-2013
Experiencia Trading
 

Viewers also liked (17)

28ª semana del tiempo ordinario. Domingo A: Mt 22, 1-14
28ª semana del tiempo ordinario. Domingo A: Mt 22, 1-1428ª semana del tiempo ordinario. Domingo A: Mt 22, 1-14
28ª semana del tiempo ordinario. Domingo A: Mt 22, 1-14
 
Riesgos
RiesgosRiesgos
Riesgos
 
1712 ee 01mc
1712 ee 01mc1712 ee 01mc
1712 ee 01mc
 
53th anniversary of the Berlin Wall
53th anniversary of the Berlin Wall53th anniversary of the Berlin Wall
53th anniversary of the Berlin Wall
 
Patología biliar benigna + CPRE + Drenaje percutaneo
Patología biliar benigna + CPRE  + Drenaje percutaneoPatología biliar benigna + CPRE  + Drenaje percutaneo
Patología biliar benigna + CPRE + Drenaje percutaneo
 
La Opera Barroca
La Opera BarrocaLa Opera Barroca
La Opera Barroca
 
Mi Trabajo 7 B
Mi Trabajo 7 BMi Trabajo 7 B
Mi Trabajo 7 B
 
Innovation Jubilation
Innovation JubilationInnovation Jubilation
Innovation Jubilation
 
Contrataciones empleo con apoyo.
Contrataciones empleo con apoyo.Contrataciones empleo con apoyo.
Contrataciones empleo con apoyo.
 
NLP meetup 2016.10.05 - Szabó Martina Katalin: Precognox
NLP meetup 2016.10.05 - Szabó Martina Katalin: PrecognoxNLP meetup 2016.10.05 - Szabó Martina Katalin: Precognox
NLP meetup 2016.10.05 - Szabó Martina Katalin: Precognox
 
Symantec Infographic - The State of Cyber Security
Symantec Infographic - The State of Cyber SecuritySymantec Infographic - The State of Cyber Security
Symantec Infographic - The State of Cyber Security
 
December14 pol monitor charts final_evening standard_economy_wr_v1_171214
December14 pol monitor charts final_evening standard_economy_wr_v1_171214December14 pol monitor charts final_evening standard_economy_wr_v1_171214
December14 pol monitor charts final_evening standard_economy_wr_v1_171214
 
Trulia American Dream Survey - Fall 2011
Trulia American Dream Survey - Fall 2011Trulia American Dream Survey - Fall 2011
Trulia American Dream Survey - Fall 2011
 
5 Secrets of Growth by Lincoln Murphy
5 Secrets of Growth by Lincoln Murphy5 Secrets of Growth by Lincoln Murphy
5 Secrets of Growth by Lincoln Murphy
 
Grafico diario del dax perfomance index para el 08 03-2013
Grafico diario del dax perfomance index para el 08 03-2013Grafico diario del dax perfomance index para el 08 03-2013
Grafico diario del dax perfomance index para el 08 03-2013
 
Symantec Infographic: The psychology of trust in websites
Symantec Infographic: The psychology of trust in websitesSymantec Infographic: The psychology of trust in websites
Symantec Infographic: The psychology of trust in websites
 
Zacarias monsalbe educacion fisica
Zacarias monsalbe educacion fisicaZacarias monsalbe educacion fisica
Zacarias monsalbe educacion fisica
 

Similar to Orchestrating docker containers at scale (PJUG edition)

Similar to Orchestrating docker containers at scale (PJUG edition) (20)

VMware@Night: Container & Virtualisierung
VMware@Night: Container & VirtualisierungVMware@Night: Container & Virtualisierung
VMware@Night: Container & Virtualisierung
 
VMware@Night Container and Virtualization
VMware@Night Container and VirtualizationVMware@Night Container and Virtualization
VMware@Night Container and Virtualization
 
Dockerizing a Symfony2 application
Dockerizing a Symfony2 applicationDockerizing a Symfony2 application
Dockerizing a Symfony2 application
 
Docker basics
Docker basicsDocker basics
Docker basics
 
Docker Ecosystem on Azure
Docker Ecosystem on AzureDocker Ecosystem on Azure
Docker Ecosystem on Azure
 
Docker for Web Developers: A Sneak Peek
Docker for Web Developers: A Sneak PeekDocker for Web Developers: A Sneak Peek
Docker for Web Developers: A Sneak Peek
 
My Journey to Becoming a Docker Captain
My Journey to Becoming a Docker CaptainMy Journey to Becoming a Docker Captain
My Journey to Becoming a Docker Captain
 
Docker for Deep Learning (Andrea Panizza)
Docker for Deep Learning (Andrea Panizza)Docker for Deep Learning (Andrea Panizza)
Docker for Deep Learning (Andrea Panizza)
 
Docker Basics
Docker BasicsDocker Basics
Docker Basics
 
Workshop Docker for DSpace
Workshop Docker for DSpaceWorkshop Docker for DSpace
Workshop Docker for DSpace
 
Dockerizing development workflow
Dockerizing development workflowDockerizing development workflow
Dockerizing development workflow
 
Scaling Jenkins with Docker: Swarm, Kubernetes or Mesos?
Scaling Jenkins with Docker: Swarm, Kubernetes or Mesos?Scaling Jenkins with Docker: Swarm, Kubernetes or Mesos?
Scaling Jenkins with Docker: Swarm, Kubernetes or Mesos?
 
Docker training
Docker trainingDocker training
Docker training
 
Docker
DockerDocker
Docker
 
Docker
DockerDocker
Docker
 
Lecture 12 - Docker
Lecture 12 - DockerLecture 12 - Docker
Lecture 12 - Docker
 
Using Docker to build and test in your laptop and Jenkins
Using Docker to build and test in your laptop and JenkinsUsing Docker to build and test in your laptop and Jenkins
Using Docker to build and test in your laptop and Jenkins
 
A Shift from Monolith to Microservice using Docker
A Shift from Monolith to Microservice using DockerA Shift from Monolith to Microservice using Docker
A Shift from Monolith to Microservice using Docker
 
ExpoQA 2017 Using docker to build and test in your laptop and Jenkins
ExpoQA 2017 Using docker to build and test in your laptop and JenkinsExpoQA 2017 Using docker to build and test in your laptop and Jenkins
ExpoQA 2017 Using docker to build and test in your laptop and Jenkins
 
codemotion-docker-2014
codemotion-docker-2014codemotion-docker-2014
codemotion-docker-2014
 

More from Maciej Lasyk

More from Maciej Lasyk (16)

Rundeck & Ansible
Rundeck & AnsibleRundeck & Ansible
Rundeck & Ansible
 
Programowanie AWSa z CLI, boto, Ansiblem i libcloudem
Programowanie AWSa z CLI, boto, Ansiblem i libcloudemProgramowanie AWSa z CLI, boto, Ansiblem i libcloudem
Programowanie AWSa z CLI, boto, Ansiblem i libcloudem
 
Co powinieneś wiedzieć na temat devops?f
Co powinieneś wiedzieć na temat devops?f Co powinieneś wiedzieć na temat devops?f
Co powinieneś wiedzieć na temat devops?f
 
Git Submodules
Git SubmodulesGit Submodules
Git Submodules
 
Under the Dome (of failure driven pipeline)
Under the Dome (of failure driven pipeline)Under the Dome (of failure driven pipeline)
Under the Dome (of failure driven pipeline)
 
Continuous Security in DevOps
Continuous Security in DevOpsContinuous Security in DevOps
Continuous Security in DevOps
 
About cultural change w/Devops
About cultural change w/DevopsAbout cultural change w/Devops
About cultural change w/Devops
 
Ghost in the shell
Ghost in the shellGhost in the shell
Ghost in the shell
 
Scaling and securing node.js apps
Scaling and securing node.js appsScaling and securing node.js apps
Scaling and securing node.js apps
 
Node.js security
Node.js securityNode.js security
Node.js security
 
High Availability (HA) Explained - second edition
High Availability (HA) Explained - second editionHigh Availability (HA) Explained - second edition
High Availability (HA) Explained - second edition
 
Monitoring with Nagios and Ganglia
Monitoring with Nagios and GangliaMonitoring with Nagios and Ganglia
Monitoring with Nagios and Ganglia
 
Stop disabling SELinux!
Stop disabling SELinux!Stop disabling SELinux!
Stop disabling SELinux!
 
High Availability (HA) Explained
High Availability (HA) ExplainedHigh Availability (HA) Explained
High Availability (HA) Explained
 
Shall we play a game? PL version
Shall we play a game? PL versionShall we play a game? PL version
Shall we play a game? PL version
 
Shall we play a game?
Shall we play a game?Shall we play a game?
Shall we play a game?
 

Recently uploaded

UNIT-V FMM.HYDRAULIC TURBINE - Construction and working
UNIT-V FMM.HYDRAULIC TURBINE - Construction and workingUNIT-V FMM.HYDRAULIC TURBINE - Construction and working
UNIT-V FMM.HYDRAULIC TURBINE - Construction and working
rknatarajan
 
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 BookingVIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
dharasingh5698
 
AKTU Computer Networks notes --- Unit 3.pdf
AKTU Computer Networks notes ---  Unit 3.pdfAKTU Computer Networks notes ---  Unit 3.pdf
AKTU Computer Networks notes --- Unit 3.pdf
ankushspencer015
 

Recently uploaded (20)

UNIT-V FMM.HYDRAULIC TURBINE - Construction and working
UNIT-V FMM.HYDRAULIC TURBINE - Construction and workingUNIT-V FMM.HYDRAULIC TURBINE - Construction and working
UNIT-V FMM.HYDRAULIC TURBINE - Construction and working
 
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
 
Online banking management system project.pdf
Online banking management system project.pdfOnline banking management system project.pdf
Online banking management system project.pdf
 
Water Industry Process Automation & Control Monthly - April 2024
Water Industry Process Automation & Control Monthly - April 2024Water Industry Process Automation & Control Monthly - April 2024
Water Industry Process Automation & Control Monthly - April 2024
 
Porous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writingPorous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writing
 
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 BookingVIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
 
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete RecordCCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
 
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSMANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
 
UNIT-II FMM-Flow Through Circular Conduits
UNIT-II FMM-Flow Through Circular ConduitsUNIT-II FMM-Flow Through Circular Conduits
UNIT-II FMM-Flow Through Circular Conduits
 
Glass Ceramics: Processing and Properties
Glass Ceramics: Processing and PropertiesGlass Ceramics: Processing and Properties
Glass Ceramics: Processing and Properties
 
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
 
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
 
Introduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptxIntroduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptx
 
University management System project report..pdf
University management System project report..pdfUniversity management System project report..pdf
University management System project report..pdf
 
UNIT-III FMM. DIMENSIONAL ANALYSIS
UNIT-III FMM.        DIMENSIONAL ANALYSISUNIT-III FMM.        DIMENSIONAL ANALYSIS
UNIT-III FMM. DIMENSIONAL ANALYSIS
 
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
 
Coefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxCoefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptx
 
AKTU Computer Networks notes --- Unit 3.pdf
AKTU Computer Networks notes ---  Unit 3.pdfAKTU Computer Networks notes ---  Unit 3.pdf
AKTU Computer Networks notes --- Unit 3.pdf
 
BSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptx
BSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptxBSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptx
BSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptx
 
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
 

Orchestrating docker containers at scale (PJUG edition)

  • 1. Maciej Lasyk JavaCamp #13 Kraków, 2014-11-22 Maciej Lasyk, Docker containers at scale 1/64 Orchestrating Docker containers at scale
  • 2. Join Fedora Infrastructure! - learn Ansible - learn Docker with Fedora Dockerfiles http://fedoraproject.org/en/join-fedora Maciej Lasyk, Docker containers at scale 2/64
  • 3. Agenda - Why use Docker? - Brief history of envs evolution - Docker – what is it? - To PaaS or not to PaaS - Orchestration at scale Maciej Lasyk, Docker containers at scale 3/64
  • 4. Quick survey - How many of you... Maciej Lasyk, Docker containers at scale 4/64
  • 5. Quick survey - How many of you... - Knows what Docker is? Maciej Lasyk, Docker containers at scale 4/64
  • 6. Quick survey - How many of you... - Knows what Docker is? - Played with Docker? Maciej Lasyk, Docker containers at scale 4/64
  • 7. Quick survey - How many of you... - Knows what Docker is? - Played with Docker? - Runs it on production? Maciej Lasyk, Docker containers at scale 4/64
  • 8. Why use Docker? With Docker we can solve many problems Maciej Lasyk, Docker containers at scale 5/64
  • 9. Why use Docker? With Docker we can solve many problems - “it works on my machine” Maciej Lasyk, Docker containers at scale 5/64
  • 10. Why use Docker? With Docker we can solve many problems - “it works on my machine” - reducing build & deploy time Maciej Lasyk, Docker containers at scale 5/64
  • 11. Why use Docker? With Docker we can solve many problems - “it works on my machine” - reducing build & deploy time - Infrastructure configuration spaghetti – automation! Maciej Lasyk, Docker containers at scale 5/64
  • 12. Why use Docker? With Docker we can solve many problems - “it works on my machine” - reducing build & deploy time - Infrastructure configuration spaghetti – automation! - Libs dependency hell Maciej Lasyk, Docker containers at scale 5/64
  • 13. Why use Docker? With Docker we can solve many problems - “it works on my machine” - reducing build & deploy time - Infrastructure configuration spaghetti – automation! - Libs dependency hell - Cost control and granularity Maciej Lasyk, Docker containers at scale 5/64
  • 14. A brief story of envs evolution - classical approach (for & scp/ssh & conf.d) Maciej Lasyk, Docker containers at scale 6/64
  • 15. A brief story of envs evolution - classical approach (for & scp/ssh & conf.d) - configuration management Maciej Lasyk, Docker containers at scale 6/64
  • 16. A brief story of envs evolution - classical approach (for & scp/ssh & conf.d) - configuration management - Bare vs IaaS vs PaaS Maciej Lasyk, Docker containers at scale 6/64
  • 17. A brief story of envs evolution - classical approach (for & scp/ssh & conf.d) - configuration management - Bare vs IaaS vs PaaS - Continuous Integration Maciej Lasyk, Docker containers at scale 6/64
  • 18. A brief story of envs evolution - classical approach (for & scp/ssh & conf.d) - configuration management - Bare vs IaaS vs PaaS - Continuous Integration - So when to use Docker? Maciej Lasyk, Docker containers at scale 6/64
  • 19. Docker – what is it? Maciej Lasyk, Docker containers at scale 7/64
  • 20. Docker – what is it? “automates the deployment of any application as a lightweight, portable, self-sufficient container that will run virtually anywhere” Maciej Lasyk, Docker containers at scale 8/64
  • 21. Docker – what is it? Java’s promise: Write Once. Run Anywhere. Maciej Lasyk, Docker containers at scale 9/64
  • 22. Docker – what is it? Java’s promise: Write Once. Run Anywhere. Even on Windows now! https://blog.docker.com/2014/10/docker-microsoft-partner-distributed-applications/ Maciej Lasyk, Docker containers at scale 9/64
  • 23. Docker – what is it? Docker is lightweight Maciej Lasyk, Docker containers at scale 10/64
  • 24. Docker – what is it? Docker is lightweight ====================================================== Package Arch Version Repository Size ====================================================== Installing: docker-io x86_64 1.3.0-1.fc20 updates 4.3 M Maciej Lasyk, Docker containers at scale 10/64
  • 25. Docker – what is it? http://sattia.blogspot.com/2014/05/docker-lightweight-linux-containers-for.html Maciej Lasyk, Docker containers at scale 11/64
  • 26. Docker – how it works? http://blog.docker.com/2014/03/docker-0-9-introducing-execution-drivers-and-libcontainer/ Maciej Lasyk, Docker containers at scale 12/64
  • 27. Docker – how it works? - LXC & libcontainer Maciej Lasyk, Docker containers at scale 13/64
  • 28. Docker – how it works? - LXC & libcontainer - control groups Maciej Lasyk, Docker containers at scale 13/64
  • 29. Docker – how it works? - LXC & libcontainer - control groups - kernel namespaces Maciej Lasyk, Docker containers at scale 13/64
  • 30. Docker – how it works? - LXC & libcontainer - control groups - kernel namespaces - layered filesystem - btrfs - devmapper thin provisioning & loopback mounts - no more AUFS - http://developerblog.redhat.com/2014/09/30/overview-storage-scalability-docker/ Maciej Lasyk, Docker containers at scale 13/64
  • 31. Docker – concepts - images - read only - act as templates Maciej Lasyk, Docker containers at scale 14/64
  • 32. Docker – concepts - images - read only - act as templates - Dockerfile - like a makefile - commands order & cache'ing - extends the base image - results in a new image Maciej Lasyk, Docker containers at scale 14/64
  • 33. Docker – concepts - images - read only - act as templates - Dockerfile - like a makefile - commands order & cache'ing - extends the base image - results in a new image - Containers: instances running apps Maciej Lasyk, Docker containers at scale 14/64
  • 34. Docker – concepts - images - read only - act as templates - Dockerfile - like a makefile - commands order & cache'ing - extends the base image - results in a new image - Containers: instances running apps dockerfile + base image = docker container Maciej Lasyk, Docker containers at scale 14/64
  • 35. Dockerfile FROM fedora MAINTAINER scollier <scollier@redhat.com> RUN yum -y update && yum clean all RUN yum -y install nginx && yum clean all RUN echo "daemon off;" >> /etc/nginx/nginx.conf RUN echo "nginx on Fedora" > /srv/www/index.html EXPOSE 80 CMD [ "/usr/sbin/nginx" ] Maciej Lasyk, Docker containers at scale 15/64
  • 36. Docker – registry http://osv.io/blog/blog/2014/06/19/containers-hypervisors-part-2/ Maciej Lasyk, Docker containers at scale 16/64
  • 37. Docker – registry - git like semantics - pull, push, commit - private and public registry - https://github.com/dotcloud/docker-registry - yum install docker-registry $ docker pull $ docker push $ docker commit Maciej Lasyk, Docker containers at scale 17/64
  • 38. Docker – images hierarchy base image -> child image -> grandchild image Maciej Lasyk, Docker containers at scale 18/64
  • 39. Docker – images hierarchy base image -> child image -> grandchild image Git’s promise: Tiny footprint with lightning fast performance Maciej Lasyk, Docker containers at scale 18/64
  • 40. Docker – images hierarchy http://blog.octo.com/en/docker-registry-first-steps/ Maciej Lasyk, Docker containers at scale 19/64
  • 41. Docker – security - Isolation via kernel namespaces - Additional layer of security: SELinux / AppArmor / GRSEC - Each container gets own network stack - control groups for resources limiting f20 policy: https://git.fedorahosted.org/cgit/selinux-policy.git/tree/docker.te?h=f20-contrib What's there? seinfo -t -x | grep docker sesearch -A -s docker_t (and the rest) or just unpack docker.pp with semodule_unpackage Maciej Lasyk, Docker containers at scale 20/64
  • 42. Docker – security Maciej Lasyk, Docker containers at scale 20/64
  • 43. Docker – use cases CI Stack http://sattia.blogspot.com/2014/05/docker-lightweight-linux-containers-for.html Maciej Lasyk, Docker containers at scale 21/64
  • 44. Docker – use cases Continuous Integration - local dev - with Docker it's easy to standardize envs - deployment - rolling updates (e.g. w/Ansible) - testing - unit testing of any commit on dedicated env - don't worry about cleaning up after testing - parrarelized tests across any machines Maciej Lasyk, Docker containers at scale 22/64
  • 45. Docker – use cases - version control system for apps - microservices - Docker embraces granularity - Services can be deployed independently and faster - parallelized tests across any machines - continuous delivery - PaaS Maciej Lasyk, Docker containers at scale 23/64
  • 46. Docker – history - 2013-01: dotCloud worked on own PaaS (Python based) - 2013-03: Docker went public (AUFS, LXC) - middle 2013: Red Hat joined, devmapper, SELinux - late 2013: removed LXC, rewritten in Go - 2014-02: stable 1.0 Maciej Lasyk, Docker containers at scale 24/64
  • 47. Docker – popularity Maciej Lasyk, Docker containers at scale 25/64
  • 48. Docker – popularity Maciej Lasyk, Docker containers at scale 26/64
  • 49. Orchestration at scale w/Docker Maciej Lasyk, Docker containers at scale 27/64
  • 50. Orchestration at scale w/Docker This might be a little problem Maciej Lasyk, Docker containers at scale 28/64
  • 51. Orchestration at scale w/Docker This might be a little problem Maciej Lasyk, Docker containers at scale 29/64
  • 52. Orchestration at scale w/Docker Maciej Lasyk, Docker containers at scale 30/64
  • 54. To Paas or not to PaaS? Maciej Lasyk, Docker containers at scale 32/64
  • 55. To Paas or not to PaaS? - you think PaaS will solve your problems? Maciej Lasyk, Docker containers at scale 33/64
  • 56. To Paas or not to PaaS? - you think PaaS will solve your problems? - it will rather clone them :) Maciej Lasyk, Docker containers at scale 33/64
  • 57. To Paas or not to PaaS? - you think PaaS will solve your problems? - it will rather clone them :) - running PaaS might be easy Maciej Lasyk, Docker containers at scale 33/64
  • 58. To Paas or not to PaaS? - you think PaaS will solve your problems? - it will rather clone them :) - running PaaS might be easy - operating PaaS will be tough Maciej Lasyk, Docker containers at scale 33/64
  • 59. To Paas or not to PaaS? - you think PaaS will solve your problems? - it will rather clone them :) - running PaaS might be easy - operating PaaS will be tough - so is operating your apps tough enough to move? Maciej Lasyk, Docker containers at scale 33/64
  • 60. To Paas or not to PaaS? - you think PaaS will solve your problems? - it will rather clone them :) - running PaaS might be easy - operating PaaS will be tough - so is operating your apps tough enough to move? - private PaaS or not? Maciej Lasyk, Docker containers at scale 33/64
  • 61. To Paas or not to PaaS? - you think PaaS will solve your problems? - it will rather clone them :) - running PaaS might be easy - operating PaaS will be tough - so is operating your apps tough enough to move? - private PaaS or not? - Rainbow and Unicorn Piss: http://blog.lusis.org/blog/2014/06/14/paas-for-realists/ Maciej Lasyk, Docker containers at scale 33/64
  • 62. To Paas or not to PaaS? Maciej Lasyk, Docker containers at scale - flynn.io - Open source PaaS (Go) - Uses Docker to manage containers - Ops should be a product team, not consultants - under development - Git push deployment - https://flynn.io 34/64
  • 63. To Paas or not to PaaS? Maciej Lasyk, Docker containers at scale - flynn.io - Open source PaaS (Go) - Uses Docker to manage containers - Ops should be a product team, not consultants - under development - Git push deployment - https://flynn.io - dokku - The smallest PaaS implementation you've ever seen - Docker powered mini-Heroku - Less than 100 lines of Bash - Git push deployment - https://github.com/progrium/dokku 34/64
  • 64. To Paas or not to PaaS? Maciej Lasyk, Docker containers at scale - flynn.io - Open source PaaS (Go) - Uses Docker to manage containers - Ops should be a product team, not consultants - under development - Git push deployment - https://flynn.io - dokku - The smallest PaaS implementation you've ever seen - Docker powered mini-Heroku - Less than 100 lines of Bash - Git push deployment - https://github.com/progrium/dokku - deis.io - Open source PaaS (Python) - Git push deployment - On top of CoreOS w/ Docker - http://deis.io/ 34/64
  • 65. To Paas or not to PaaS? Don't forget maestro-ng! https://github.com/signalfuse/maestro-ng Maciej Lasyk, Docker containers at scale - flynn.io - Open source PaaS (Go) - Uses Docker to manage containers - Ops should be a product team, not consultants - under development - Git push deployment - https://flynn.io - dokku - The smallest PaaS implementation you've ever seen - Docker powered mini-Heroku - Less than 100 lines of Bash - Git push deployment - https://github.com/progrium/dokku - deis.io - Open source PaaS (Python) - Git push deployment - On top of CoreOS w/ Docker - http://deis.io/ 34/64
  • 66. To Paas or not to PaaS? Remember, that PaaS might fail; plan & test for disaster ! Maciej Lasyk, Docker containers at scale 35/64
  • 67. Docker & CLI $ docker run -t -i fedora /bin/bash > yum -y update > yum -y install nginx $ docker commit 73fa45674fd docent/fedora Maciej Lasyk, Docker containers at scale 36/64
  • 68. Docker & CLI Or via Dockerfile: $ docker build -t fedora –rm . $ docker run --name=nginx fedora Maciej Lasyk, Docker containers at scale 37/64
  • 69. FIG - http://www.fig.sh - for single host env Maciej Lasyk, Docker containers at scale 38/64
  • 70. FIG - http://www.fig.sh - for single host env FROM python:2.7 ENV PYTHONUNBUFFERED 1 RUN mkdir /code WORKDIR /code ADD requirements.txt /code/ RUN pip install -r requirements.txt ADD . /code/ Maciej Lasyk, Docker containers at scale 39/64
  • 71. FIG db: image: postgres web: build: . command: python manage.py runserver 0.0.0.0:8000 volumes: - /srv/app/code:/code ports: - "8000:8000" links: - db Maciej Lasyk, Docker containers at scale 40/64
  • 72. FIG $ fig run web django-admin.py startproject figexample . $ fig up Management during runtime? $ fig run web python manage.py syncdb Maciej Lasyk, Docker containers at scale 41/64
  • 73. Docker & Ansible Ansible + Docker & Docker + Ansible Maciej Lasyk, Docker containers at scale 42/64
  • 74. Docker & Ansible Ansible docker core module: http://docs.ansible.com/docker_module.html - hosts: web sudo: yes tasks: - name: run tomcat servers docker: > image=centos command="service tomcat6 start" ports=8080 count=5 memory_limit=128MB link=mysql expose=8080 registry=... volume=... Maciej Lasyk, Docker containers at scale 43/64
  • 75. Docker & Ansible Building image with Ansible: FROM ansible/centos7-ansible:stable ADD ansible /srv/example/ WORKDIR /srv/example RUN ansible-playbook web.yml -c local EXPOSE 80 ENTRYPOINT ["/usr/sbin/nginx", "-DFOREGROUND"] Maciej Lasyk, Docker containers at scale 44/64
  • 76. Docker & Ansible Building image with Ansible: FROM ansible/centos7-ansible:stable ADD ansible /srv/example/ WORKDIR /srv/example RUN ansible-playbook web.yml -c local EXPOSE 80 ENTRYPOINT ["/usr/sbin/nginx", "-DFOREGROUND"] ansible/web.yml: - hosts: localhost tasks: - yum: pkg=nginx state=latest - copy: src: web.conf dest: /etc/nginx/conf.d/web.conf group: "nginx" mode: "0644" Maciej Lasyk, Docker containers at scale 44/64
  • 77. CoreOS - Designedfor massive server deployments - Support Docker container out of the box - Available onLinux, Mac, and Windows - It's a Chrome OS fork - Consists of couple of components: - SystemD – not just a init system ;) - Fleet – cluster level manager & scheduler - etcd – light & distributed key / value store - Docker – the only packaging method in CoreOS Maciej Lasyk, Docker containers at scale 45/64
  • 78. CoreOS Maciej Lasyk, Docker containers at scale 45/64
  • 79. CoreOS Fleet – cluster level manager & scheduler https://coreos.com/using-coreos/clustering/ Maciej Lasyk, Docker containers at scale 46/64
  • 80. CoreOS etcd – light & distributed key / value store (used for configuration store) https://coreos.com/docs/#cluster-management Maciej Lasyk, Docker containers at scale 47/64
  • 81. CoreOS Docker – the only packaging method in CoreOS Maciej Lasyk, Docker containers at scale 48/64
  • 82. CoreOS Maciej Lasyk, Docker containers at scale 49/64
  • 83. CoreOS Cluster management with Fleet & SystemD [Unit] Description=My Service After=docker.service [Service] TimeoutStartSec=0 ExecStartPre=-/usr/bin/docker kill hello ExecStartPre=-/usr/bin/docker rm hello ExecStartPre=/usr/bin/docker pull busybox ExecStart=/usr/bin/docker run --name hello busybox /bin/sh -c "while true; do echo Hello World; sleep 1; done" ExecStop=/usr/bin/docker stop hello Maciej Lasyk, Docker containers at scale 50/64
  • 84. CoreOS Cluster management with Fleet & SystemD $ fleetctl load hello.service Unit hello.service loaded on 8145ebb7.../10.10.1.3 $ fleetctl start hello.service Unit hello.service launched on 8145ebb7.../10.10.1.3 $ fleetctl list-machines MACHINE IP METADATA 148a18ff-6e95-4cd8-92da-c9de9bb90d5a 10.10.1.1 - 491586a6-508f-4583-a71d-bfc4d146e996 10.10.1.2 - c9de9451-6a6f-1d80-b7e6-46e996bfc4d1 10.10.1.3 - $ fleetctl list-units UNIT MACHINE ACTIVE SUB hello.service c9de9451.../10.10.1.3 active running Maciej Lasyk, Docker containers at scale 51/64
  • 85. CoreOS - scheduler - HA - dependencies https://coreos.com/docs/launching-containers/launching/launching-containers-fleet/ Maciej Lasyk, Docker containers at scale 52/64
  • 86. Kubernetes - https://github.com/GoogleCloudPlatform/kubernetes - Advanced cluster manager (more than 1k hosts is a fit) - Architecture: - master - minion - pod - replication controller - label Maciej Lasyk, Docker containers at scale 53/64
  • 87. Kubernetes Maciej Lasyk, Docker containers at scale 54/64
  • 88. Kubernetes Maciej Lasyk, Docker containers at scale 54/64
  • 89. SmartStack - automated service discovery and registration framework - ideal for SOA architectures - ideal for continuous integration & delivery - solves “works on my machine” problem Maciej Lasyk, Docker containers at scale 55/64
  • 90. SmartStack - automated service discovery and registration framework - ideal for SOA architectures - ideal for continuous integration & delivery - solves “works on my machine” problem haproxy + nerve + synapse + zookeper = smartstack Maciej Lasyk, Docker containers at scale 56/64
  • 91. SmartStack Synapse - discovery service (via zookeeper or etcd) - installed on every node - writes haproxy configuration - application doesn't have to be aware of this - works same on bare / VM / docker - https://github.com/airbnb/nerve Maciej Lasyk, Docker containers at scale 57/64
  • 92. SmartStack Maciej Lasyk, Docker containers at scale 58/64
  • 93. SmartStack Nerve - health checks (pluggable) - register service info to zookeper (or etcd) - https://github.com/airbnb/synapse Maciej Lasyk, Docker containers at scale 59/64
  • 94. SmartStack Maciej Lasyk, Docker containers at scale 60/64
  • 95. SmartStack Maciej Lasyk, Docker containers at scale 60/64
  • 96. SmartStack Smartstack + Docker = <3 Maciej Lasyk, Docker containers at scale 60/64
  • 97. Summary Maciej Lasyk, Docker containers at scale 61/64
  • 98. Summary w/ Docker Sky is the limit! Maciej Lasyk, Docker containers at scale 61/64
  • 99. Freenode #docker Krk DevOPS meetups (http://www.meetup.com/Krakow-DevOps/) https://github.com/docker/docker Maciej Lasyk, Docker containers at scale 62/64
  • 100. sources? - docker.io documentation - dockerbook.com - slideshare! - zounds of blogposts (urls provided) - and some experience ;) Maciej Lasyk, Docker containers at scale 63/64
  • 101. Thank you :) Orchestrating Docker containers at scale Maciej Lasyk JavaCamp #13 2014-11-22, Kraków http://maciej.lasyk.info maciej@lasyk.info @docent-net Maciej Lasyk, Docker containers at scale 64/64

Editor's Notes

  1. - knows vagrant? - knows differences between hyplev2 hyplev1 and containers? - czy quick sort jest szybszy od heap sorta (kopcowanie)?
  2. Bare: na pczątku był serwer, potem OS a potem wirtualna maszyna javy żeby to wszystko działało tak samo ;)
  3. Chaos monkey!