Slide 1

Slide 1 text

What is docker? Docker Belgium - #dockerbel Nils De Moor - @ndemoor

Slide 2

Slide 2 text

• Nils De Moor • CTO & co-founder at WooRank • #node #mongo #ansible #automation #devops About me

Slide 3

Slide 3 text

Why docker? Source: https://www.docker.io/learn_more/

Slide 4

Slide 4 text

Why docker? Source: https://www.docker.io/learn_more/

Slide 5

Slide 5 text

Why docker? Source: https://www.docker.io/learn_more/

Slide 6

Slide 6 text

• Isolation • Portability • Compatibility • Automation • Speed Why docker? “Run anything... anywhere”

Slide 7

Slide 7 text

• LXC Containers • “Chroot on steroids” • AUFS • layered view on merged directories • copy-on-write What and how?

Slide 8

Slide 8 text

git clone github.com/ndemoor/dockerbel git checkout hello-world

Slide 9

Slide 9 text

• Install docker in vagrant box • Execute commands “Hello world” docker run ubuntu echo Hello World docker run ubuntu touch /tmp/test docker ps -a docker diff [CONTAINER_ID] docker run -d ubuntu /bin/sh -c "while true; do date; sleep 1; done" docker ps docker logs [CONTAINER_ID]

Slide 10

Slide 10 text

No content

Slide 11

Slide 11 text

BUILDING Images Source: https://docs.docker.io

Slide 12

Slide 12 text

• Scripting language • Automated builder • Create images • Cached Dockerfile

Slide 13

Slide 13 text

git checkout building-images

Slide 14

Slide 14 text

FROM ubuntu # make sure the package repository is up to date RUN echo "deb http://archive.ubuntu.com/ubuntu precise main universe" > /etc/apt/sources.list RUN apt-get update # install memcached RUN apt-get install -y memcached # run as user daemon (memcached doesn't allow to run as root) USER daemon # expose memcached port EXPOSE 11211 # Launch memcached when launching the container ENTRYPOINT ["memcached"]

Slide 15

Slide 15 text

Source: http://www.funnymemes.com/wp-content/uploads/ 2013/08/Cute-memes-sharing-is-caring.jpg

Slide 16

Slide 16 text

Sharing images Source: https://www.docker.io/learn_more/

Slide 17

Slide 17 text

Sharing images Source: https://www.docker.io/learn_more/

Slide 18

Slide 18 text

• Roll-your-own image repository • Share images privately • https://github.com/dotcloud/docker-registry Docker Registry

Slide 19

Slide 19 text

• Public image repository • Similar to npm, PyPI, bower, apt, yum, ... • Trusted builds • Search from docker cli • https://index.docker.io Docker index

Slide 20

Slide 20 text

docker login docker push dockerbel/memcached

Slide 21

Slide 21 text

No content

Slide 22

Slide 22 text

git checkout application

Slide 23

Slide 23 text

FROM ubuntu ENV NODE_VERSION 0.10.24 # Install common packages RUN apt-get update RUN apt-get install -y wget # Install node RUN mkdir /opt/node-$NODE_VERSION RUN wget -O /tmp/node-$NODE_VERSION.tar.gz http://nodejs.org/ dist/v$NODE_VERSION/node-v$NODE_VERSION-linux-x64.tar.gz RUN tar zxf /tmp/node-$NODE_VERSION.tar.gz --strip-components=1 --no-same-owner -C /opt/node-$NODE_VERSION RUN ln -s /opt/node-$NODE_VERSION/bin/node /usr/local/bin/node RUN ln -s /opt/node-$NODE_VERSION/bin/npm /usr/local/bin/npm ADD . /var/www RUN cd /var/www && npm install EXPOSE 3000 CMD [ "node", "/var/www/server.js" ]

Slide 24

Slide 24 text

# run memcache container docker run -d -name memcache dockerbel/memcached # run app container, linked to memcache container docker run -d -p 3000:3000 -e ENV=dev -link memcache:mc -v /tmp/log/app:/var/log/app:rw -name app dockerbel/app

Slide 25

Slide 25 text

• Maturity (1.0 in the next months) • Pluggable approach • Wider OS support • More filesystem options What’s next?

Slide 26

Slide 26 text

• Deis - deployment and orchestration • Dokku - deployment • Fig - deployment • Flynn - deployment and orchestration • Shipyard - monitoring Community

Slide 27

Slide 27 text

Questions?

Slide 28

Slide 28 text

Thank you! Docker Belgium - #dockerbel Nils De Moor - @ndemoor Psst... we’re hiring