Slide 1

Slide 1 text

Docker Build, Ship and Run any app, anywhere

Slide 2

Slide 2 text

What is Docker? Docker is an open platform for developers and sysadmins to build, ship, and run distributed applications. Consisting of Docker Engine, a portable, lightweight runtime and packaging tool, and Docker Hub, a cloud service for sharing applications and automating workflows […] Solomon Hykes, Docker’s Founder & CTO

Slide 3

Slide 3 text

What is container? Container are to virtual machines as threads are to processes. Or you can think of them as chroot on steroids. Will Sargent • More than a sandbox, less than a VM • Deployable and runnable artifact • Lightweight Linux environment

Slide 4

Slide 4 text

Back in time Server Host OS App Host OS Host OS Hypervisor Docker Bin Server Server App App App V os V os Bin Bin App App Bin Bin

Slide 5

Slide 5 text

Why using container? • We are not only shipping code but conf, environment and code • Containers are lightweight, fast, isolated and reproducible environments • Docker provides a simple way to write, version, build, deploy and run environments

Slide 6

Slide 6 text

#> Let’s give a try

Slide 7

Slide 7 text

#> Run container #> docker images #> docker run -t -i ubuntu /bin/bash #> uname -r #> docker images #> docker run -t -i centos /bin/bash #> uname -r #> docker images

Slide 8

Slide 8 text

#> Run container #> docker pull nginx #> docker run --name nginx_inst1 -d nginx #> docker ps #> docker stop nginx_inst1 #> docker ps #> docker ps -a #> docker start nginx_inst1 #> docker ps

Slide 9

Slide 9 text

#> Container & Host - Network #> docker run --name nginx_network -d -p 8080:80 nginx #> curl http://127.0.0.1:8080 #> docker inspect nginx_network | grep IPAddress #> iptables -t nat -L

Slide 10

Slide 10 text

#> Container & Host - Filesystem #> mkdir /docker_nginx_fs #> echo "Hello World!" > /docker_nginx_fs/index2.html #> docker run --name nginx_fs -d -p 8081:80 -v /docker_nginx_fs:/usr/share/nginx/html nginx #> curl http://127.0.0.1:8081/index2.html

Slide 11

Slide 11 text

#> Dockerfile FROM ubuntu:14.04 RUN \ sed -i 's/# \(.*multiverse$\)/\1/g' /etc/apt/sources.list && \ apt-get update && apt-get install -y mono-complete ADD ./publish/ /publish EXPOSE 8123 CMD ["mono", "/publish/HelloWorld.exe"]

Slide 12

Slide 12 text

#> Build container #> git clone https://github.com/MiKaDoO/nancyfx-ubuntu- docker.git #> docker build -t mickael/hello-nancy #> sudo docker run -p 8082:8123 -d mickael/hello-nancy #> curl http://127.0.0.1:8082

Slide 13

Slide 13 text

#> Your own PAAS Dokuu is a mini-Heroku powered by Docker written in less than 100 lines of Bash $ cd node-js-sample $ git remote add dokku [email protected]:node-js-app $ git push dokku master Counting objects: 296, done. Delta compression using up to 4 threads. Compressing objects: 100% (254/254), done. Writing objects: 100% (296/296), 193.59 KiB, done. Total 296 (delta 25), reused 276 (delta 13) -----> Building node-js-app ... Node.js app detected -----> Resolving engine versions ... blah blah blah ... -----> Application deployed: http://node-js-app.dokku.me

Slide 14

Slide 14 text

One container ok. But how to scale? • Kubernetes by Google • Apache Mesos • Marathon • Docker tools • Compose, Swarm, Machine, Hub

Slide 15

Slide 15 text

How to start? • Custom server • Dedian, Ubuntu, Fedora… • Cloud platform • Azure, Digital Ocean, App Engine, Aws… • Your machine • Boot2Docker

Slide 16

Slide 16 text

How to start? • Docker documentation • DockerCon videos • Docker Paris meetup • Pluralsight course • Twitter university

Slide 17

Slide 17 text

Thank you Any question?