cohesion techsessie docker - daniel palstra
TRANSCRIPT
It’s pretty much the best
thing for cloud computing
since the movement from
bare metal
to virtual machines
Ho Ming Li (DockerCon 2014 attendant)
Docker aims to reduce the
cycle time between
code being written
and code being tested,
deployed, and used.
James Turnbull (author of The Docker Book)
Docker is one of those
technologies that, without any
great fuss and without
anyone noticing, is now
everywhere. […]
I wouldn’t call Docker a
“Swiss Army Knife”
— it has so many more uses
than that.
Dr Mike Norman (Cloud Services Architect @
JP Morgan)
#whoami
• Daniël Palstra
• Docker Trainer @ Amazic
• DevOps consultant & engineer(self employed)
• Middleware & cloud
technologies
• 10+ yrs IT experience
• @dpalstra
DevOps means giving a shit
about your job enough
to want to learn all the parts
and not just your little world.
John E. Vincent (blog.lusis.org)
The real value of Docker is not
technology,
it’s getting people to agree on
something.
Solomon Hykes (Founder of Docker)
What is Container
Virtualisation?• Alternative to “traditional” virtualisation on Hypervisors such
as VMWare
• No guest operating system (or booting) required for
containers
• Virtualisation layer runs as an application inside the host
OS
• Sandboxed execution environment
• Lightweight, high performance (especially on bare metal
hardware)
Where does Docker fit
in?• Built on top of Linux container technology (LXC, AUFS)
• Provides tools to build, run, share and version “images”
• Handles communication between running “containers”
(network, fs)
• Docker containers run practically everywhere
• Extremely reproducible; you could start from scratch
every time!
Images versus
Containers• Docker images consist of one or more read-only layered
file-systems
• The bottom layer is called the base image (Linux kernel,
e.g. Red Hat)
• A Dockerfile is the equivalent of a build file to create an
image
• Docker containers are the running, stateful instances of
images
• Modified containers can also be committed back to images
FROM jboss/wildfly
MAINTAINER Bastiaan Schaap <http://github.com/siteminds>
RUN /opt/jboss/wildfly/bin/add-user.sh --silent admin admin
ADD sample.war /opt/jboss/wildfly/standalone/deployments/
EXPOSE 8080
EXPOSE 9990
Sample Dockerfile
Volumes and mounting• Share directories and files with
• Docker Containers
• Docker Hosts
• Define volumes
• Runtime (docker run -v)
• Build time (VOLUME /path/to/my/directory)
• Ambassador containers
• Pluggable!
Container linking
• Container Port mapping
• Docker linking system
• Name containers and provide link
docker run --name web --link db:mongodb -d -p 8080:80
nginx
Logging
• Multiple log driver support
• Container != Host logging
docker logs -f nostalgic_morse
docker inspect -f '{{ .NetworkSettings.IPAddress }}' nostalgic_morse
172.17.0.5
• Cloud-based registry
service
• Official images
• User defined images
• On premis solution
available
• Connect with Github
Docker Hub
• Docker Client
• Docker Machine
• Docker Compose (Mac
only)
• Docker Kitematic
• VirtualBox
Docker Toolbox
Docker Machine
• Simplify creation and configuration of
Docker Hosts (inc security)
• Boot2docker >> docker-machine
• Multiple providers:
…
$ docker-machine ls
NAME ACTIVE DRIVER STATE URL SWARM
default * virtualbox Running tcp://192.168.99.100:2376
swarm-01 digitalocean Running
swarm-02 digitalocean Running
Docker Compose
• Define and run multi container applications
• Complete application lifecycle management
• Orchestration tool combined with Machine and Swarm
web:
build: .
ports:
- "5000:5000"
volumes:
- .:/code
links:
- redis
redis:
image: redis
Docker Swarm
• Docker Host clustering
• Smart Container Scheduling
• Docker-Machine &
Docker compose Integration
• Pluggable Node Discovery
• Container communication over multiple hosts (experimental)
Pros
• Standardized way of getting code from development to production
• Easy to use DevOps workflow
• Fast container startup
• Isolation of processes and their configuration
• Amazing growth in functionality
Cons
• Very easy to do, can be very hard to do right
• Networking can be difficult
• Ecosystem evolving (rapidly)
• Which orchestration tools/platforms/frameworks to use