Techsessie Docker
2015
17 september 2015
Presentatie Daniël Palstra
Let’s talk Docker..
@dpalstra
Daniël Palstra
Docker… wut?!
Why should
youcare
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)
Dev to Ops the old way..
Dev to Ops the new way!
#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)
10,000
feet
WAY UP
The real value of Docker is not
technology,
it’s getting people to agree on
something.
Solomon Hykes (Founder of Docker)
Containers &
Images
NEXT UP
Almost everything in Google
runs in a container.
Brian Dorsey (Google Cloud)
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!
Docker containers
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
Docker build
demo
NEXT UP
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
Where did my data go?
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!
Linking
Glueing containers together
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 &
inspection
What’s happening in my
env?
Logging
• Multiple log driver support
• Container != Host logging
docker logs -f nostalgic_morse
docker inspect -f '{{ .NetworkSettings.IPAddress }}' nostalgic_morse
172.17.0.5
Docker Hub
Where to get my images from?
• Cloud-based registry
service
• Official images
• User defined images
• On premis solution
available
• Connect with Github
Docker Hub
Docker
Toolbox
Cool! How do I get started?
• 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
Orchestration &
Clustering
Docker Swarm
• Docker Host clustering
• Smart Container Scheduling
• Docker-Machine &
Docker compose Integration
• Pluggable Node Discovery
• Container communication over multiple hosts (experimental)
3th party tooling
Conclusion
FINALLY..
Pros
• Standardized way of getting code from development to produc
• 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
Questions?
THANK YOU
@dpalstra
daniel@amazic.com
Demo time!

Cohesion Techsessie Docker - Daniel Palstra

  • 1.
  • 2.
  • 3.
  • 4.
  • 5.
  • 6.
    It’s pretty muchthe best thing for cloud computing since the movement from bare metal to virtual machines Ho Ming Li (DockerCon 2014 attendant)
  • 7.
    Docker aims toreduce the cycle time between code being written and code being tested, deployed, and used. James Turnbull (author of The Docker Book)
  • 8.
    Docker is oneof 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)
  • 10.
    Dev to Opsthe old way..
  • 12.
    Dev to Opsthe new way!
  • 13.
    #whoami • Daniël Palstra •Docker Trainer @ Amazic • DevOps consultant & engineer (self employed) • Middleware & cloud technologies • 10+ yrs IT experience • @dpalstra
  • 14.
    DevOps means givinga shit about your job enough to want to learn all the parts and not just your little world. John E. Vincent (blog.lusis.org)
  • 15.
  • 23.
    The real valueof Docker is not technology, it’s getting people to agree on something. Solomon Hykes (Founder of Docker)
  • 24.
  • 25.
    Almost everything inGoogle runs in a container. Brian Dorsey (Google Cloud)
  • 26.
    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)
  • 28.
    Where does Dockerfit 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!
  • 29.
  • 30.
    Images versus Containers • Dockerimages 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
  • 32.
  • 33.
    FROM jboss/wildfly MAINTAINER BastiaanSchaap <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
  • 34.
  • 35.
    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!
  • 36.
  • 37.
    Container linking • ContainerPort mapping • Docker linking system • Name containers and provide link docker run --name web --link db:mongodb -d -p 8080:80 nginx
  • 38.
  • 39.
    Logging • Multiple logdriver support • Container != Host logging docker logs -f nostalgic_morse docker inspect -f '{{ .NetworkSettings.IPAddress }}' nostalgic_morse 172.17.0.5
  • 40.
    Docker Hub Where toget my images from?
  • 41.
    • Cloud-based registry service •Official images • User defined images • On premis solution available • Connect with Github Docker Hub
  • 42.
  • 43.
    • Docker Client •Docker Machine • Docker Compose (Mac only) • Docker Kitematic • VirtualBox Docker Toolbox
  • 44.
    Docker Machine • Simplifycreation 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
  • 45.
    Docker Compose • Defineand 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
  • 46.
  • 47.
    Docker Swarm • DockerHost clustering • Smart Container Scheduling • Docker-Machine & Docker compose Integration • Pluggable Node Discovery • Container communication over multiple hosts (experimental)
  • 48.
  • 49.
  • 51.
    Pros • Standardized wayof getting code from development to produc • Easy to use DevOps workflow • Fast container startup • Isolation of processes and their configuration • Amazing growth in functionality
  • 52.
    Cons • Very easyto do, can be very hard to do right • Networking can be difficult • Ecosystem evolving (rapidly) • Which orchestration tools/platforms/frameworks to use
  • 53.
  • 54.
  • 55.

Editor's Notes

  • #5 Some hands for who already heard of Docker before Some hands for who already played around Docker Some hands for who already use Docker in production
  • #7 If you don’t believe me let’s have a look at what other people are saying about Docker
  • #10 Docker has taken the world by storm. Docker clearly solves some problems, otherwise adaptation wouldn’t be as huge as it is today. Although Docker isn’t perfect (yet), and doesn’t fix all continuous delivery problems, it does a damn good job at making our DevOps life a bit easier.
  • #11 Does this look familiair? Numerous deployments to numerous kinds of Operating systems.
  • #13 The modern process. Dev delivers standard packages which can be deployed by anyone in the same way every time over and over. Ops only cares about keeping the platform stable where the packages (containers) live
  • #14 Building DevOps solutions. Considers himself half dev half ops. Strong background in middleware and SOA. Believes in delivering software at anytime and any moment. Will only allow himself to use cool software that brings customers forward. Hates the phrase “because we’re always doing it like this”.
  • #15 So what is DevOps? I think John E. Vincent nails it with his definition. DevOps is about caring enough about the stuff you build to take responsibility for it from inception until decommission.
  • #16 Ok let’s get this thing started. Why are we are we here in the first place? What problem are we going to solve?
  • #17 The big problem challenge in 2015 IT solutions. Multiple services and apps build on different technologies. Multiple hosting providers build on top of different “hosting technologies”. How can we get everything to work with each other without tight coupling every app with each other. Hands please for people who have seen this problem before.
  • #18 But there is hope! We IT guys are not the first ones to run into problems like these. Logistics suffered from this problem years and years ago. Let’s have a look at how things where done in the old days.
  • #19 Dockers in the old days!
  • #20 Dockers nowadays
  • #22 Transportation managed to agree on the delivery process. Wouldn’t it be great if we follow there footsteps and use that same process.
  • #40 Docker containers and docker hosts can have there own logging mechanism. Docker supports multiple logging drivers which can be used by containers or hosts. By default docker logs to JSON format. Docker log https://docs.docker.com/reference/logging/overview/ Next to docker logs docker inspect can be used to check the health of a container and a docker host
  • #42 If your favorite platform isn’t linux one should download the Docker toolbox to get started. The docker toolbox consists of components that get
  • #44 If your favorite platform isn’t linux one should download the Docker toolbox to get started. The docker toolbox consists of components that get
  • #49 http://www.quora.com/What-is-the-best-Docker-Linux-Container-orchestration-tool
  • #56 https://gist.github.com/botchagalupe/53695f50eebbd3eaa9aa