Docker
Presentation by Patrick Oberdorf
Who am I?
• Name: Patrick Oberdorf
• Age: 23 (06.09.1991)
• City: Dortmund
• Company: raphael GmbH
• Position: head of server
administration
Who is using it or similar
technology?
What is „Docker“?
• Docker != virtual machines
• Docker = OS-level
• Container and host share a kernel
• In short: improved chroot
• Available for Linux, Mac (boot2docker), Windows
(in the near future)
• Useful for servers and development environments
• Idea itself isn't new (FreeBSD jail - 1998)
• Docker makes it just easy
source: http://en.wikipedia.org/wiki/Docker_(software)
Docker Hub
• Repository for Images
• Images are versioned
• Changes of Images are stored like a „git commit“
• Many images for „mysql, php, apache, nginx,
gitlab, jenkins, …“
Dockerfile
• Instruction how to build the image
• Very easy (just normal „shell“ commands)
• Extend an existing Image
Linking
• Container linking
• IP linking (entry in hosts-file)
• Volumes linking (through aufs-filesystem)
Host Container
random port
Filesystem Filesystemaufs
Host Container
random port
Filesystem Filesystem
aufs
Container
Filesystem
port
aufs
Host Apache/PHP
port 80
Filesystem Filesystem
/var/www
MySQL
Filesystem
db:3306
/var/lib/mysql
Host Apache/PHP
port 80
Filesystem Filesystem
/var/www
MySQL
Filesystem
db:3306
/var/lib/mysql
domain.tld:80 Host
proxy
Apache
MySQL
domain.tld:4554
domain.tld:80
Host
proxy
Apache
MySQL
dom
ain.tld:4554
Apache
MySQL
test.tld:80
test.tld:4555
Persistent Data
• 2 ways to store persistent data
• Through aufs on the host (good)
• Through volumes linking from a data-only-container
(better)
Why data-only-container?
• Define "storing data" as an application and not
guess the host is able to do it
• Not every host is able to store the data in a way you
need it (Windows a-z == A-Z)
How to define a data-only-
container
• Just expose mountpoints with "VOLUME" in the
Dockerfile
• Data-only-container doesn't need to be running,
they just need to exist
• Ofc: care about backups
Advantages
• Dependencies hassle-free
• Easy deployment
• Security -> „chroot“
• Limit ressources (CPU, RAM, …)
• Easy monitoring (`docker stats` >=1.5)
• Write once, run anywhere
Disadvantages
• Needs a deployment system
• System updates
• Persistent data
• Readjust the workflow
• No ssh into the machine …

Docker