@ndeloof @dgageot#DV14 #Docker@ndeloof
Meet the Dockers
@ndeloof @dgageot#DV14 #Docker
@ndeloof @dgageot#DV14 #Docker
@ndeloof @dgageot#DV14 #Docker
@ndeloof @dgageot#DV14 #Docker
@ndeloof @dgageot#DV14 #Docker
Why ?
@ndeloof @dgageot#DV14 #Docker
As a Developer
@ndeloof @dgageot#DV14 #Docker
I code using …
@ndeloof @dgageot#DV14 #Docker
I run tests on …
@ndeloof @dgageot#DV14 #Docker
I deploy app to …
@ndeloof @dgageot#DV14 #Docker
and (sometime) it fails :’(
@ndeloof @dgageot#DV14 #Docker
@ndeloof @dgageot#DV14 #Docker
Some told me to …
@ndeloof @dgageot#DV14 #Docker Demo of a VM
@ndeloof @dgageot#DV14 #Docker
OS kernel
File System (libs, …)
services Hypervisor
OS kernel
(virtual) File System
services application runtime (JDK)
application
data (memory / disk)
emulation
@ndeloof @dgageot#DV14 #Docker
@ndeloof @dgageot#DV14 #Docker
@ndeloof @dgageot#DV14 #Docker
OS kernel
File System (libs, …)
services Hypervisor
OS kernel
(virtual) File System
services application runtime (JDK)
application
data (memory / disk)
emulation
hardware virtualization
@ndeloof @dgageot#DV14 #Docker
@ndeloof @dgageot#DV14 #Docker
What’s a VM
@ndeloof @dgageot#DV14 #Docker
my App
rsyslogd
cron
/sbin/getty
/sbin/init
dhclient
sshd -D
Some0mes worse
@ndeloof @dgageot#DV14 #Docker
Why do we need VM ?✓Different Operating System ✓Different CPU Architecture ✓Work with multiples versions ✓Move application to a different server
@ndeloof @dgageot#DV14 #Docker
Docker contract :
@ndeloof @dgageot#DV14 #Docker Demo of a simple container
@ndeloof @dgageot#DV14 #Docker
OS kernel
File System (libs, …)
services
(virtual) File System
services application runtime (JDK)
application
data (memory / disk)
Hypervisor
OS kernel
emulation
@ndeloof @dgageot#DV14 #Docker
@ndeloof @dgageot#DV14 #Docker
Union file system
copy-on-write layers
@ndeloof @dgageot#DV14 #Docker
JDK
OS kernel
File System (libs, …)
docker -D base image
ruby
rails
data
app.js
data data
jar
node
@ndeloof @dgageot#DV14 #Docker
OS kernel
File System (libs, …)
docker -D base image
JDK
bar.jar
data data
ruby
railsfoo.jar
data
@ndeloof @dgageot#DV14 #Docker
OS kernel
File System (libs, …)
docker -D base image
JDK
app.jar
data data data
@ndeloof @dgageot#DV14 #Docker
Infrastructure as Code
@ndeloof @dgageot#DV14 #Docker
Dockerfile
•simple (simplistic?) DSL
•pure text file
•share it, pull-request it
•execution cache
@ndeloof @dgageot#DV14 #DockerDockerfile
@ndeloof @dgageot#DV14 #DockerWho will use it ?
Developer
@ndeloof @dgageot#DV14 #Docker
Not on Linux ?
@ndeloof @dgageot#DV14 #Docker
DEV
✓Quickly get third party tools up-and-running
@ndeloof @dgageot#DV14 #Docker
DEV
✓Exact reproduction for target environment
@ndeloof @dgageot#DV14 #Docker
DEV
✓`docker build` to replace `mvn install`
@ndeloof @dgageot#DV14 #Docker
DEV
✓Reference environment
✓Bug reproduction scenario
Tester
@ndeloof @dgageot#DV14 #Docker
Test resources
✓ Define build / test infra in your SCM
•Database
•Messaging Middleware
•…
@ndeloof @dgageot#DV14 #Docker
Test
✓ Automate reproducible tests
@ndeloof @dgageot#DV14 #DockerJenkins + Docker
@ndeloof @dgageot#DV14 #Docker
✓ Quickly get low-cost iso-production environment
QA
P.O. / Sales
@ndeloof @dgageot#DV14 #Docker
Run a demo
✓ Ready to run demo
✓ No setup stress
✓ No technical skills required
✓ Can share with partners
Production
Dev/Opsa WAR archive is NOT what a sysadmin expect as delivery
+
best DevOps tool so far (imho)
@ndeloof @dgageot#DV14 #Docker
Dev/Opsa WAR archive is NOT what a sysadmin expect as delivery
+
@ndeloof @dgageot#DV14 #Docker
@ndeloof @dgageot#DV14 #Docker
best DevOps tool so far (imho)
@ndeloof @dgageot#DV14 #Docker
Separation of concern
Inside container /var/log/myapp
On host /mnt/backup/myapp/log
@ndeloof @dgageot#DV14 #Docker
Separation of concerns
VOLUMEInside container /var/log/myapp
On host /mnt/backup/myapp/log
@ndeloof @dgageot#DV14 #Docker
✓ Manage hardware / infrastructure
✓ Monitoring / backups
- Not apps « implementation details »
Ops
@ndeloof @dgageot#DV14 #Docker
✓ Develop simplest possible solution
✓ Configuration is a runtime constraint
- Not extra-extra-flexibile application
new WebServer().start(8080);
Dev
Continuous Delivery
@ndeloof @dgageot#DV14 #Docker
from SCM to production
@ndeloof @dgageot#DV14 #Docker
Continuous Delivery
@ndeloof @dgageot#DV14 #Docker
Continuous Delivery
•100% Reproducible environments
Dockerfile build WAR
from sources
Dockerfile run
acceptance
Dockerfile build
deployable
docker run | docker build -
@ndeloof @dgageot#DV14 #Docker build chain
@ndeloof @dgageot#DV14 #Docker
What for ?
✓ Cloud
✓ devices
✓ on-premisesmore to come …
@ndeloof @dgageot#DV14 #DockerNew architectures
@ndeloof @dgageot#DV14 #Docker
LightWeight VM ?
@ndeloof @dgageot#DV14 #Docker
1 process per container !
@ndeloof @dgageot#DV14 #Docker
OS kernel
File System (libs, …)
services (virtual) File System
services application runtime (JDK)
application
data (memory / disk)
@ndeloof @dgageot#DV14 #Docker
OS kernel
File System (libs, …)
services (virtual) File System
application runtime (JDK)
application
data (memory / disk)
vFS
runtime
service
data
@ndeloof @dgageot#DV14 #Docker
OS kernel
File System (libs, …)
services (virtual) File System
application runtime (JDK)
application
data (memory / disk)
vFS
runtime
service
data
@ndeloof @dgageot#DV14 #Docker
host
sample : syslog
http://jpetazzo.github.io/2014/08/24/syslog-docker/
rsyslog
/dev/log
/tmp/syslogdev
logger "hello"
/dev/log
@ndeloof @dgageot#DV14 #Docker
Diviser pour mieux régnerStop with monolithes !
@ndeloof @dgageot#DV14 #Docker
Diviser pour mieux régnerembrace Micro-services ‣ « the unix way » ‣ domain focussed ‣ quick release cycles ‣ segregate resources
http://yobriefca.se/blog/2013/04/29/micro-service-architecture/
@ndeloof @dgageot#DV14 #Docker
Micro-‐service avec Docker
LINK
@ndeloof @dgageot#DV14 #Docker
Time to LiveVirtual Machine : some months (years ?)
Container(s) : might just be few minutes
@ndeloof @dgageot#DV14 #Docker
Docker pattern: Ambassador
webapp redis
ambassador ambassador
@ndeloof @dgageot#DV14 #Docker
Docker pattern: service discovery
webapp redis
skyDNSskyDock
--dns --dns
@ndeloof @dgageot#DV14 #Docker
Docker pattern: Data Container
postgres dbdata--volumes-from
postgres-2backup
-v /dbdata
@ndeloof @dgageot#DV14 #Docker
Immutable infrastructures
@ndeloof @dgageot#DV14 #Docker
Upgrades
Upgrade applicatif = deploy a new image
@ndeloof @dgageot#DV14 #Docker
What about CM ?
@ndeloof @dgageot#DV14 #Docker
pimp my Dockerfile
Dockerfile ONBUILD COPY /cookbooksONBUILD RUN chef-solo
Dockerfile FROM chef-solo
@ndeloof @dgageot#DV14 #Docker
Orchestrate Docker
load balancer
webapp
database replica
webapp
monitoring
cache- hosts: web sudo: yes tasks: - name: run tomcat servers docker: image=webapp ports=8080
@ndeloof @dgageot#DV14 #Docker
@ndeloof @dgageot#DV14 #Docker
Q?