Slide 1

Slide 1 text

Docker 101 Introduction to Docker and Lightweight Containers

Slide 2

Slide 2 text

Hi I'm Mario Italian based in Paris Software Engineer @ Zenika (ex IBMer) Docker official trainer and contributor I've developped sublime docker and doclipser mariolet l0rd

Slide 3

Slide 3 text

Some well known problems Steve, the (un)believer developer: "It works on my machine!" Bill, an (im)patient developer: "It took me one week to setup the development environment"

Slide 4

Slide 4 text

One solution: Traditional Virtual Machines ● Consistent environments ● Repeatable wherever you want ● Versioning ● Automated setup

Slide 5

Slide 5 text

A better solution: Lightweight Containers

Slide 6

Slide 6 text

Why Docker? Lightweight containers is a 15yrs old technology. With Docker it has become: ● Easy to use ● Widely adopted ● Defined a standard

Slide 7

Slide 7 text

Easy to run a container docker run -ti ubuntu

Slide 8

Slide 8 text

Easy to run a container What happened here? ● Generated an Linux container ● Allocated a new file system ● Mounted a read/write layer ● Allocated a network interface ● Set an IP for it ● Run a process inside the container ● Captured the output and returned to the client

Slide 9

Slide 9 text

DockerHub and official images

Slide 10

Slide 10 text

Easy to create a custom image Dockerfile FROM ubuntu RUN apt-get install -y curl CMD curl ipinfo.io/ip $ docker build -t mycustomimage . $ docker run mycustomimage

Slide 11

Slide 11 text

Volumes to persist data This cattle vs pets thing docker run -ti ubuntu docker run -ti ubuntu Volumes and the state of an application docker run -ti -v ~/data/:/data/ ubuntu

Slide 12

Slide 12 text

Links to let containers talk securely # Run tomcat in a container docker run -d --name myserver tomcat # Access to tomcat from another container docker run --link myserver \ fedora \ curl myserver:8080

Slide 13

Slide 13 text

Multi-containers configurations db: image: postgres web: build: . command: python manage.py runserver 0.0.0.0:8000 volumes: - .:/code ports: - "8000:8000" links: - db Docker Compose YML file