The busy developers guide to DockerMaurice de Beijer - @mauricedb
ROME 24-25 MARCH 2017
2
Who am I?
• Maurice de Beijer• The Problem Solver• Microsoft Azure MVP• Freelance developer/instructor• Twitter: @mauricedb and @React_Tutorial• Web:http://www.TheProblemSolver.nl• E-mail: [email protected]
3
Overview
• What are containers• Why use container technology?• What is Docker• Creating and running Docker images• Hosting a Docker image on Azure
4
What is a container?
5
Once upon a ship
6Loading cargo the old way
7
A container ship these days
8
Loading is a bit faster
9
Running virtual machines
Virtual Machines vs Containers
10
11
NamespacesCgroupsUnion file system
What is Docker?
12
Docker Hub
13
14
Why use Docker?
• Package an application with it’s dependencies• Dev environment behaves exactly like production• Less overhead means more deployments on a server• Deploy the same container in different clouds• Not just for cloud computing• Docker has standardized container formats• It’s open source
15
Some other Docker Use Cases
• Simulate deployed environment during development– Each container simulates a machine
• Share containers between developers– Database containers with sample data• Also use in the (automated) QA environment
– Build containers with compilers and libraries• Also use in the CI environment
16
Build
ing
cont
aine
rs
17
Useful docker image commands
• docker images• docker pull <image name>• docker build –t <image name> <folder>• docker run <image name>• docker rmi <image id>• docker rmi $(docker images -q -f dangling=true)
18
Useful docker container commands
• Docker ps• docker logs <container name>• docker stop <container name>• docker start <container name>• docker kill <container id>• docker rm <container id>• docker rm $(docker ps -a -q)
19
20
Orchestration
21
Dock
er C
ompo
se
22
23
The
min
imal
Doc
kerfi
le
24
Nod
e on
Alp
ine
25
Dock
er o
n W
indo
ws
26
Containers can be great…
27
28…with the right tools!
29
30
31
32
33
34
35
36
Maurice de Beijer - @mauricedb