DevOps #S01E01
Docker overview
(useful) Analogy
From industry to IT
From industry to IT
From industry to IT
Package it!
Containers technology
Mature technology
Success story
– Speed: Boots in seconds
– Footprint: 100-1000 containers by machine
– Public registry: hundreds of useful containers
– Build and versionning processes: git flavor
VM vs Container
Anatomy
Build once, run anywhere*
Docker lifecycle
– A build produces an immuable image
– A container is an instance of the image
Dockerfile
– Describe the way to build your container
– Imperative not Declarative
– A mix of RUN, ADD commands
Dockerfile, nginx
FROM ubuntu
MAINTAINER your@email.com
# Install deps
RUN sudo apt-get update && sudo apt-get install -y nginx
[ . . . ]
# Add some static files
ADD my-static-dir /usr/share/nginx/html/
# Expose ports
EXPOSE 80 443
# Run the server
CMD nginx
First build
Docker run
– Create an instance of an image: container
– Start the container with a specific config
– Run runs a process and stops when it dies
Docker run
docker run <mode> <ports> <volume> <image> <cmd>
First run
Docker run
Daemon VS Interactive
-it: foreground, attach a tty and STDIN
-d: damonized container
Docker run
Ports mapping
-p <host>:<guest> // -p 8080:80 (map 8080 to 80)
-p <ip>:<host>:<guest> // for listening interface
All rules are iptables
Docker run
Volume mount points
-v <host_directory>:<target>
Docker run
Override default usage
/bin/bash: useful for debugging purposes
/bootsrap.sh --with-my-config =value
etc.
Docker run
Other (very) cool stuff
--net: DHCP/Host/Bridge
--link + name:
-e VAR=VAL: set env variables inside the container
.dockerignore (like .gitignore)
Docker run
Other (very) cool stuff (cont’d)
--privileged and –CAP: for security
--user: first owner
--cpuset: assign vcore to the container
See https://docs.docker.com/reference/run/#user
Demo
Docker lifecycle
CI, big picture
Support us!
Guillaume Polaert / @gpolaert
https://registry.hub.docker.com/u/ingensi

2014 12-03 - docker devops-tours

Editor's Notes

  • #9 Propulsé par dotCloud, Mars 2013 Cgroups en 2006 par Google Solaris Containers 2004 Chroot en 1982 LXC en 2013 OpenVZ en 2005 Jailes BSD en 1985